Commit ab0e9fa1 authored by Tong Zhang's avatar Tong Zhang Committed by Mauro Carvalho Chehab

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: default avatarMike Isely <isely@pobox.com>
Co-developed-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarTong Zhang <ztong0001@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 92345d1b
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment