diff options
author | Tong Zhang <ztong0001@gmail.com> | 2020-08-20 19:52:40 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-08-26 19:50:11 +0300 |
commit | ab0e9fa1579d5e372822038e9d2a6d21c164ede6 (patch) | |
tree | df1113b386b622c31b87301e51b58939486f3479 /drivers/media/usb/pvrusb2/pvrusb2-hdw.c | |
parent | 92345d1b47c2da02fadef2162a90fbc8dd8f9204 (diff) | |
download | linux-ab0e9fa1579d5e372822038e9d2a6d21c164ede6.tar.xz |
media: pvrusb2: fix parsing error
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>
Diffstat (limited to 'drivers/media/usb/pvrusb2/pvrusb2-hdw.c')
-rw-r--r-- | drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 5 |
1 files 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; |