lkml.org 
[lkml]   [2020]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] media: pvrusb2: fix parsing error

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

\
 
 \ /
  Last update: 2020-08-20 19:01    [W:0.053 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site