From: Yizhuo Date: Mon, 26 Aug 2019 23:55:28 +0000 (-0300) Subject: media: pvrusb2: qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns error... X-Git-Tag: v5.4-rc1~145^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0fb68ce02ae73626a61b8d03eab1625021057af5;p=platform%2Fkernel%2Flinux-rpi.git media: pvrusb2: qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns error code Inside function ctrl_cx2341x_getv4lflags(), qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns -EINVAL. However, it will be used in the later if statement, which is potentially unsafe. Signed-off-by: Yizhuo Acked-by: Mike Isely Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c index 2a946cff84b7..1cfb7cf64131 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c @@ -784,7 +784,7 @@ static int ctrl_cx2341x_set(struct pvr2_ctrl *cptr,int m,int v) static unsigned int ctrl_cx2341x_getv4lflags(struct pvr2_ctrl *cptr) { - struct v4l2_queryctrl qctrl; + struct v4l2_queryctrl qctrl = {}; struct pvr2_ctl_info *info; qctrl.id = cptr->info->v4l_id; cx2341x_ctrl_query(&cptr->hdw->enc_ctl_state,&qctrl);