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

From: Henne
Date: Fri Aug 22 2008 - 16:16:31 EST


From: Henrik Kretzschmar <henne@xxxxxxxxxxxxxxxx>
Signed-off-by: Henrik Kretzschmar <henne@xxxxxxxxxxxxxxxx>

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;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/