mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Isely <isely@isely.net>
To: Tong Zhang <ztong0001@gmail.com>
Cc: mchehab@kernel.org, linux-media@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Mike Isely at pobox <isely@pobox.com>
Subject: Re: [PATCH v3] media: pvrusb2: fix parsing error
Date: Thu, 20 Aug 2020 11:55:13 -0500 (CDT)	[thread overview]
Message-ID: <alpine.DEB.2.11.2008201154460.4428@cnc.isely.net> (raw)
In-Reply-To: <20200820165239.8510-1-ztong0001@gmail.com>


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

On Thu, 20 Aug 2020, Tong Zhang wrote:

> pvr2_std_str_to_id() returns 0 on failure and 1 on success,
> however the caller is checking failure case using <0
> 
> Co-developed-by: Hans Verkuil<hverkuil@xs4all.nl>
> Signed-off-by: Tong Zhang <ztong0001@gmail.com>
> ---
> 
> v2: return -EINVAL as suggested by Hans Verkuil<hverkuil@xs4all.nl>.
> I also rebased the code on v5.9-rc1.
> v3: remove unused variable
> 
>  drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> index 1cfb7cf64131..f4a727918e35 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> @@ -864,10 +864,9 @@ static int ctrl_std_sym_to_val(struct pvr2_ctrl *cptr,
>  			       const char *bufPtr,unsigned int bufSize,
>  			       int *mskp,int *valp)
>  {
> -	int ret;
>  	v4l2_std_id id;
> -	ret = pvr2_std_str_to_id(&id,bufPtr,bufSize);
> -	if (ret < 0) return ret;
> +	if (!pvr2_std_str_to_id(&id, bufPtr, bufSize))
> +		return -EINVAL;
>  	if (mskp) *mskp = id;
>  	if (valp) *valp = id;
>  	return 0;
> 

-- 

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

  reply	other threads:[~2020-08-20 17:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-16  6:49 [PATCH] " Tong Zhang
2020-08-19 14:38 ` Hans Verkuil
2020-08-19 16:37   ` Tong Zhang
2020-08-19 21:25   ` [PATCH v2] " Tong Zhang
2020-08-20 11:44     ` Hans Verkuil
2020-08-20 16:52       ` [PATCH v3] " Tong Zhang
2020-08-20 16:55         ` Mike Isely [this message]
2020-08-20 16:55       ` [PATCH v2] " Tong Zhang
2020-08-19 21:26   ` [PATCH] " Tong Zhang

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.11.2008201154460.4428@cnc.isely.net \
    --to=isely@isely.net \
    --cc=hverkuil@xs4all.nl \
    --cc=isely@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ztong0001@gmail.com \
    /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®