mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tong Zhang <ztong0001@gmail.com>
To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	mchehab@kernel.org, isely@pobox.com
Cc: ztong0001@gmail.com
Subject: [PATCH] media: pvrusb2: fix parsing error
Date: Sun, 16 Aug 2020 02:49:00 -0400	[thread overview]
Message-ID: <20200816064901.977682-1-ztong0001@gmail.com> (raw)

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


             reply	other threads:[~2020-08-16  6:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-16  6:49 Tong Zhang [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200816064901.977682-1-ztong0001@gmail.com \
    --to=ztong0001@gmail.com \
    --cc=isely@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®