linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] HID: wacom: NULL dereferences on error in probe()
@ 2015-06-24 14:27 Dan Carpenter
  2015-06-25 20:59 ` Jason Gerecke
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2015-06-24 14:27 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, kernel-janitors

We can't pass a NULL to input_unregister_device().

Fixes: 2a6cdbdd4cc0 ('HID: wacom: Introduce new 'touch_input' device')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 4c0ffca..44958d7 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -1271,11 +1271,13 @@ fail_leds:
 	pad_input_dev = NULL;
 	wacom_wac->pad_registered = false;
 fail_register_pad_input:
-	input_unregister_device(touch_input_dev);
+	if (touch_input_dev)
+		input_unregister_device(touch_input_dev);
 	wacom_wac->touch_input = NULL;
 	wacom_wac->touch_registered = false;
 fail_register_touch_input:
-	input_unregister_device(pen_input_dev);
+	if (pen_input_dev)
+		input_unregister_device(pen_input_dev);
 	wacom_wac->pen_input = NULL;
 	wacom_wac->pen_registered = false;
 fail_register_pen_input:

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

* Re: [patch] HID: wacom: NULL dereferences on error in probe()
  2015-06-24 14:27 [patch] HID: wacom: NULL dereferences on error in probe() Dan Carpenter
@ 2015-06-25 20:59 ` Jason Gerecke
  2015-06-26 12:08   ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Gerecke @ 2015-06-25 20:59 UTC (permalink / raw)
  To: Dan Carpenter, Jiri Kosina; +Cc: linux-input, kernel-janitors

On 6/24/2015 7:27 AM, Dan Carpenter wrote:
> We can't pass a NULL to input_unregister_device().
> 
> Fixes: 2a6cdbdd4cc0 ('HID: wacom: Introduce new 'touch_input' device')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 

Looks reasonable to me.
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>

-- 
Jason
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one /
(That is to say, eight) to the two, /
But you can’t take seven from three, /
So you look at the sixty-fours....

> diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
> index 4c0ffca..44958d7 100644
> --- a/drivers/hid/wacom_sys.c
> +++ b/drivers/hid/wacom_sys.c
> @@ -1271,11 +1271,13 @@ fail_leds:
>  	pad_input_dev = NULL;
>  	wacom_wac->pad_registered = false;
>  fail_register_pad_input:
> -	input_unregister_device(touch_input_dev);
> +	if (touch_input_dev)
> +		input_unregister_device(touch_input_dev);
>  	wacom_wac->touch_input = NULL;
>  	wacom_wac->touch_registered = false;
>  fail_register_touch_input:
> -	input_unregister_device(pen_input_dev);
> +	if (pen_input_dev)
> +		input_unregister_device(pen_input_dev);
>  	wacom_wac->pen_input = NULL;
>  	wacom_wac->pen_registered = false;
>  fail_register_pen_input:
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [patch] HID: wacom: NULL dereferences on error in probe()
  2015-06-25 20:59 ` Jason Gerecke
@ 2015-06-26 12:08   ` Jiri Kosina
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2015-06-26 12:08 UTC (permalink / raw)
  To: Jason Gerecke; +Cc: Dan Carpenter, linux-input, kernel-janitors

On Thu, 25 Jun 2015, Jason Gerecke wrote:

> > Fixes: 2a6cdbdd4cc0 ('HID: wacom: Introduce new 'touch_input' device')
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Looks reasonable to me.
> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>

Applied to for-4.2/upstream-fixes. Thanks,

-- 
Jiri Kosina
SUSE Labs

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

end of thread, other threads:[~2015-06-26 12:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-24 14:27 [patch] HID: wacom: NULL dereferences on error in probe() Dan Carpenter
2015-06-25 20:59 ` Jason Gerecke
2015-06-26 12:08   ` 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).