From: isely@isely.net
To: Yizhuo <yzhai003@ucr.edu>
Cc: csong@cs.ucr.edu, zhiyunq@cs.ucr.edu,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Mike Isely at pobox <isely@pobox.com>
Subject: Re: [PATCH] [media] pvrusb2: qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns error code
Date: Sun, 25 Aug 2019 12:47:20 -0500 (CDT) [thread overview]
Message-ID: <alpine.DEB.2.20.1908251247040.22242@lochley.isely.net> (raw)
In-Reply-To: <20190821210931.9621-1-yzhai003@ucr.edu>
Acked-by: Mike Isely <isely@pobox.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@ucr.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
next prev parent reply other threads:[~2019-08-25 17:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-21 21:09 Yizhuo
2019-08-23 1:31 ` kbuild test robot
2019-08-25 17:47 ` isely [this message]
2019-08-26 12:08 ` Hans Verkuil
2019-08-26 23:32 ` Yizhuo Zhai
2019-08-26 23:55 Yizhuo
2019-08-26 23:56 ` isely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1908251247040.22242@lochley.isely.net \
--to=isely@isely.net \
--cc=csong@cs.ucr.edu \
--cc=isely@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=yzhai003@ucr.edu \
--cc=zhiyunq@cs.ucr.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®