diff mbox series

[-next] HID: thrustmaster: fix return value check in thrustmaster_probe()

Message ID 20210402094041.3424285-1-weiyongjun1@huawei.com (mailing list archive)
State Mainlined
Commit ed1ab6ff213a701d4a635883c63e0d6fcbbab27d
Delegated to: Jiri Kosina
Headers show
Series [-next] HID: thrustmaster: fix return value check in thrustmaster_probe() | expand

Commit Message

Wei Yongjun April 2, 2021, 9:40 a.m. UTC
Fix the return value check which testing the wrong variable
in thrustmaster_probe().

Fixes: c49c33637802 ("HID: support for initialization of some Thrustmaster wheels")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/hid/hid-thrustmaster.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jiri Kosina May 5, 2021, 12:26 p.m. UTC | #1
On Fri, 2 Apr 2021, Wei Yongjun wrote:

> Fix the return value check which testing the wrong variable
> in thrustmaster_probe().
> 
> Fixes: c49c33637802 ("HID: support for initialization of some Thrustmaster wheels")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/hid/hid-thrustmaster.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-thrustmaster.c b/drivers/hid/hid-thrustmaster.c
> index bfcd08759ba0..fada3536f60e 100644
> --- a/drivers/hid/hid-thrustmaster.c
> +++ b/drivers/hid/hid-thrustmaster.c
> @@ -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,
diff mbox series

Patch

diff --git a/drivers/hid/hid-thrustmaster.c b/drivers/hid/hid-thrustmaster.c
index bfcd08759ba0..fada3536f60e 100644
--- a/drivers/hid/hid-thrustmaster.c
+++ b/drivers/hid/hid-thrustmaster.c
@@ -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;
 	}