From: Dan Carpenter <dan.carpenter@linaro.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] HID: fix an error code in hid_check_device_match()
Date: Tue, 6 Jun 2023 11:20:54 +0300 [thread overview]
Message-ID: <ZH7sZv4PEovkMxNP@moroto> (raw)
The hid_check_device_match() returns true if we find a match and false
if we don't. But here it returns -ENODEV which becomes true instead
of false.
Fixes: 207733f92661 ("HID: split apart hid_device_probe to make logic more apparent")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/hid/hid-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 4b7062dcefec..8992e3c1e769 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -2593,7 +2593,7 @@ static bool hid_check_device_match(struct hid_device *hdev,
{
*id = hid_match_device(hdev, hdrv);
if (!*id)
- return -ENODEV;
+ return false;
if (hdrv->match)
return hdrv->match(hdev, hid_ignore_special_drivers);
--
2.30.2
next reply other threads:[~2023-06-06 8:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 8:20 Dan Carpenter [this message]
2023-06-06 8:50 ` [PATCH] HID: fix an error code in hid_check_device_match() Benjamin Tissoires
2023-06-06 17:19 ` Dmitry Torokhov
2023-06-08 15:01 ` Jiri Kosina
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=ZH7sZv4PEovkMxNP@moroto \
--to=dan.carpenter@linaro.org \
--cc=benjamin.tissoires@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=jikos@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.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;
as well as URLs for NNTP newsgroup(s).