Skip to content

Commit

Permalink
media: pvrusb2: fix parsing error
Browse files Browse the repository at this point in the history
pvr2_std_str_to_id() returns 0 on failure and 1 on success,
however the caller is checking failure case using <0

Acked-by: Mike Isely <isely@pobox.com>
Co-developed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Tong Zhang authored and Mauro Carvalho Chehab committed Aug 26, 2020
1 parent 92345d1 commit ab0e9fa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/media/usb/pvrusb2/pvrusb2-hdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ab0e9fa

Please sign in to comment.