[PATCH] V4L: fix retval in vivi driver for more than one device

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <mchehab@...>
Cc: <video4linux-list@...>, <linux-kernel@...>
Date: Friday, August 22, 2008 - 4:16 pm

From: Henrik Kretzschmar <henne@nachtwindheim.de>
Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>

The variable ret should be set for each device to -ENOMEM, not only the first.

diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 3518af0..d739b59 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -1106,11 +1106,12 @@ static struct video_device vivi_template = {
 
 static int __init vivi_init(void)
 {
-	int ret = -ENOMEM, i;
+	int ret, i;
 	struct vivi_dev *dev;
 	struct video_device *vfd;
 
 	for (i = 0; i < n_devs; i++) {
+		ret = -ENOMEM;
 		dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 		if (NULL == dev)
 			break;


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] V4L: fix retval in vivi driver for more than one dev..., Henne, (Fri Aug 22, 4:16 pm)
Re: [PATCH] V4L: fix retval in vivi driver for more than one..., Mauro Carvalho Chehab, (Sun Aug 24, 10:00 am)
Re: [PATCH] V4L: fix retval in vivi driver for more than one..., Mauro Carvalho Chehab, (Sun Aug 24, 10:58 am)