Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <yzhai003@ucr.edu>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

authored by

Yizhuo and committed by
Mauro Carvalho Chehab
0fb68ce0 ecbce48f

+1 -1
+1 -1
drivers/media/usb/pvrusb2/pvrusb2-hdw.c
··· 784 784 785 785 static unsigned int ctrl_cx2341x_getv4lflags(struct pvr2_ctrl *cptr) 786 786 { 787 - struct v4l2_queryctrl qctrl; 787 + struct v4l2_queryctrl qctrl = {}; 788 788 struct pvr2_ctl_info *info; 789 789 qctrl.id = cptr->info->v4l_id; 790 790 cx2341x_ctrl_query(&cptr->hdw->enc_ctl_state,&qctrl);