public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] V4L: fix retval in vivi driver for more than one device
@ 2008-08-22 20:16 Henne
  2008-08-24 14:00 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 4+ messages in thread
From: Henne @ 2008-08-22 20:16 UTC (permalink / raw)
  To: mchehab; +Cc: video4linux-list, linux-kernel

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;



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-08-24 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-22 20:16 [PATCH] V4L: fix retval in vivi driver for more than one device Henne
2008-08-24 14:00 ` Mauro Carvalho Chehab
2008-08-24 14:34   ` Hans Verkuil
2008-08-24 14:58     ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox