HID: fix an error code in hid_check_device_match()
Subsystems (2)
PATCH 1/1 HID: fix an error code in hid_check_device_match()
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.
--- drivers/hid/hid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-core.c +1 -1
@@ -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);
Signature · 1 line
2.30.2
Quoted 16 lines · Dan Carpenter
The
hid_check_device_match()returns true if we find a match and false if we don't. But here it returns-ENODEVwhich becomes true instead of false.Fixes 207733f92661 ("HID: split apart hid_device_probe to make logic more apparent")Signed-off-by Dan Carpenter <[email protected]>--- drivers/hid/hid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hid/hid-core.c +0
-0
drivers/hid/hid-core.c static bool hid_check_device_match(struct hid_device *hdev, · line 2596
Quoted 5 lines
drivers/hid/hid-core.c +1
-1@@ -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;
Thanks for spotting this!
Cheers,
Benjamin
Quoted 6 lines
drivers/hid/hid-core.c +0
-0if (hdrv->match)return hdrv->match (hdev, hid_ignore_special_drivers);Signature · 1 line
2.30.2
Quoted 15 lines · Dan Carpenter
The
hid_check_device_match()returns true if we find a match and false if we don't. But here it returns-ENODEVwhich becomes true instead of false.Fixes 207733f92661 ("HID: split apart hid_device_probe to make logic more apparent")Signed-off-by Dan Carpenter <[email protected]>--- drivers/hid/hid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hid/hid-core.c +0
-0
drivers/hid/hid-core.c static bool hid_check_device_match(struct hid_device *hdev, · line 2596
Quoted 5 lines
drivers/hid/hid-core.c +1
-1@@ -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;
Ugh, I goofed up, thank you for noticing this Dan.
Thanks.
Signature · 1 line
Dmitry
Jiri Kosina
maintainerQuoted 15 lines · Dan Carpenter
The
hid_check_device_match()returns true if we find a match and false if we don't. But here it returns-ENODEVwhich becomes true instead of false.Fixes 207733f92661 ("HID: split apart hid_device_probe to make logic more apparent")Signed-off-by Dan Carpenter <[email protected]>--- drivers/hid/hid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hid/hid-core.c +0
-0
drivers/hid/hid-core.c static bool hid_check_device_match(struct hid_device *hdev, · line 2599
Quoted 8 lines
drivers/hid/hid-core.c +1
-1@@ -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);
Thanks for checking this! Applied.
Signature · 2 lines
Jiri Kosina SUSE Labs