Skip to contentSkip to conversation

HID: thrustmaster: fix return value check in thrustmaster_probe()

PATCH In review Wei Yongjun 2 participants 2 messages Apr 2, 2021 – May 5, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: thrustmaster: fix return value check in thrustmaster_probe()

Fix the return value check which testing the wrong variable in thrustmaster_probe().

Fixes c49c33637802 ("HID: support for initialization of some Thrustmaster wheels")
---
 drivers/hid/hid-thrustmaster.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-thrustmaster.c +1 -1
index bfcd08759ba0..fada3536f60e 100644
@@ -311,7 +311,7 @@ static int thrustmaster_probe(struct hid_device *hdev, const struct hid_device_i
 	}
 
 	tm_wheel->change_request = kzalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL);
-	if (!tm_wheel->model_request) {
+	if (!tm_wheel->change_request) {
 		ret = -ENOMEM;
 		goto error5;
 	}
maintainer
#1 lore raw
Quoted 15 lines · Wei Yongjun

Fix the return value check which testing the wrong variable in thrustmaster_probe().

Fixes c49c33637802 ("HID: support for initialization of some Thrustmaster wheels")
---
 drivers/hid/hid-thrustmaster.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-thrustmaster.c +0 -0
index bfcd08759ba0..fada3536f60e 100644

drivers/hid/hid-thrustmaster.c static int thrustmaster_probe(struct hid_device *hdev, const struct hid_device_i · line 315

Quoted 6 lines
drivers/hid/hid-thrustmaster.c +1 -1
@@ -311,7 +311,7 @@ static int thrustmaster_probe(struct hid_device *hdev, const struct hid_device_i
 	}
 
 	tm_wheel->change_request = kzalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL);
-	if (!tm_wheel->model_request) {
+	if (!tm_wheel->change_request) {
 		ret = -ENOMEM;

Good catch, applied. Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs