lkml.org 
[lkml]   [2019]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [media] pvrusb2: qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns error code

Acked-by: Mike Isely <isely@pobox.com>

On Mon, 26 Aug 2019, Yizhuo wrote:

> 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>
> ---
> drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> index ad5b25b89699..66a34fb9e6b2 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> @@ -790,7 +790,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);
>

--

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8

\
 
 \ /
  Last update: 2019-08-27 01:57    [W:0.237 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site