mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: pvrusb2: fix parsing error
@ 2020-08-16  6:49 Tong Zhang
  2020-08-19 14:38 ` Hans Verkuil
  0 siblings, 1 reply; 9+ messages in thread
From: Tong Zhang @ 2020-08-16  6:49 UTC (permalink / raw)
  To: linux-kernel, linux-media, mchehab, isely; +Cc: ztong0001

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@gmail.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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-08-20 17:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-16  6:49 [PATCH] media: pvrusb2: fix parsing error Tong Zhang
2020-08-19 14:38 ` Hans Verkuil
2020-08-19 16:37   ` Tong Zhang
2020-08-19 21:25   ` [PATCH v2] " Tong Zhang
2020-08-20 11:44     ` Hans Verkuil
2020-08-20 16:52       ` [PATCH v3] " Tong Zhang
2020-08-20 16:55         ` Mike Isely
2020-08-20 16:55       ` [PATCH v2] " Tong Zhang
2020-08-19 21:26   ` [PATCH] " Tong Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®