kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] HID: thrustmaster: fix return value check in thrustmaster_probe()
@ 2021-04-02  9:40 Wei Yongjun
  2021-05-05 12:26 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2021-04-02  9:40 UTC (permalink / raw)
  To: weiyongjun1, Dario Pagani, Jiri Kosina, Benjamin Tissoires,
	Maxime Coquelin, Alexandre Torgue
  Cc: linux-input, linux-stm32, linux-arm-kernel, kernel-janitors, Hulk Robot

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;
 		goto error5;
 	}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] HID: thrustmaster: fix return value check in thrustmaster_probe()
  2021-04-02  9:40 [PATCH -next] HID: thrustmaster: fix return value check in thrustmaster_probe() Wei Yongjun
@ 2021-05-05 12:26 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2021-05-05 12:26 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Dario Pagani, Benjamin Tissoires, Maxime Coquelin,
	Alexandre Torgue, linux-input, linux-stm32, linux-arm-kernel,
	kernel-janitors, Hulk Robot

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,

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-05 12:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-02  9:40 [PATCH -next] HID: thrustmaster: fix return value check in thrustmaster_probe() Wei Yongjun
2021-05-05 12:26 ` Jiri Kosina

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).