media: staging/imx: Fix uninitialized variable warning
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 30 Aug 2017 17:14:36 +0000 (13:14 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sat, 23 Sep 2017 11:24:50 +0000 (07:24 -0400)
The ret variable can be returned uninitialized in the
imx_media_create_pad_vdev_lists() function is imxmd->num_vdevs is zero.
Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/staging/media/imx/imx-media-dev.c

index d96f4512224ffb11fd13900422d6da1498ab8697..b55e5ebba8b4194df4392e259062e9b483be491d 100644 (file)
@@ -400,10 +400,10 @@ static int imx_media_create_pad_vdev_lists(struct imx_media_dev *imxmd)
                                        struct media_link, list);
                ret = imx_media_add_vdev_to_pad(imxmd, vdev, link->source);
                if (ret)
-                       break;
+                       return ret;
        }
 
-       return ret;
+       return 0;
 }
 
 /* async subdev complete notifier */