media: vpbe_venc: potential uninitialized variable in ven_sub_dev_init()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 20 Apr 2018 10:13:52 +0000 (06:13 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 9 May 2018 20:15:59 +0000 (16:15 -0400)
Smatch complains that "venc" could be uninitialized.  There are a couple
of error paths where it looks like maybe that could happen.  I don't know
if it's really a bug, but it's reasonable to set "venc" to NULL and
silence the warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/davinci/vpbe_venc.c

index 5c255de3b3f8b09af8842372b92425f111cbe80d..ba157827192c661e2321f8b0ae6cf71a976836c8 100644 (file)
@@ -606,7 +606,7 @@ static int venc_device_get(struct device *dev, void *data)
 struct v4l2_subdev *venc_sub_dev_init(struct v4l2_device *v4l2_dev,
                const char *venc_name)
 {
-       struct venc_state *venc;
+       struct venc_state *venc = NULL;
 
        bus_for_each_dev(&platform_bus_type, NULL, &venc,
                        venc_device_get);