From: Dan Carpenter Date: Fri, 20 Apr 2018 10:13:52 +0000 (-0400) Subject: media: vpbe_venc: potential uninitialized variable in ven_sub_dev_init() X-Git-Tag: v4.18-rc1~107^2~186 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=6246c3a43bfde6b845290e397e35f1d7cd902050;p=linux.git media: vpbe_venc: potential uninitialized variable in ven_sub_dev_init() 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/davinci/vpbe_venc.c b/drivers/media/platform/davinci/vpbe_venc.c index 5c255de3b3f8..ba157827192c 100644 --- a/drivers/media/platform/davinci/vpbe_venc.c +++ b/drivers/media/platform/davinci/vpbe_venc.c @@ -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);