[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200816064901.977682-1-ztong0001@gmail.com>
Date: Sun, 16 Aug 2020 02:49:00 -0400
From: Tong Zhang <ztong0001@...il.com>
To: linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
mchehab@...nel.org, isely@...ox.com
Cc: ztong0001@...il.com
Subject: [PATCH] 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
Signed-off-by: Tong Zhang <ztong0001@...il.com>
---
drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
index 1cfb7cf64131..db5aa66c1936 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
@@ -867,7 +867,8 @@ static int ctrl_std_sym_to_val(struct pvr2_ctrl *cptr,
int ret;
v4l2_std_id id;
ret = pvr2_std_str_to_id(&id,bufPtr,bufSize);
- if (ret < 0) return ret;
+ if (ret == 0)
+ return ret;
if (mskp) *mskp = id;
if (valp) *valp = id;
return 0;
--
2.25.1
Powered by blists - more mailing lists