[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1908251247040.22242@lochley.isely.net>
Date: Sun, 25 Aug 2019 12:47:20 -0500 (CDT)
From: isely@...ly.net
To: Yizhuo <yzhai003@....edu>
cc: csong@...ucr.edu, zhiyunq@...ucr.edu,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-media@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Mike Isely at pobox <isely@...ox.com>
Subject: Re: [PATCH] [media] pvrusb2: qctrl.flag will be uninitlaized if
cx2341x_ctrl_query() returns error code
Acked-by: Mike Isely <isely@...ox.com>
On Wed, 21 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@....edu>
> ---
> drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> index ad5b25b89699..1fa05971316a 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> @@ -793,6 +793,7 @@ static unsigned int ctrl_cx2341x_getv4lflags(struct pvr2_ctrl *cptr)
> struct v4l2_queryctrl qctrl;
> struct pvr2_ctl_info *info;
> qctrl.id = cptr->info->v4l_id;
> + memset(&qctr, 0, sizeof(qctrl))
> cx2341x_ctrl_query(&cptr->hdw->enc_ctl_state,&qctrl);
> /* Strip out the const so we can adjust a function pointer. It's
> OK to do this here because we know this is a dynamically created
>
--
Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
Powered by blists - more mailing lists