Skip to content

Commit

Permalink
HID: wacom: NULL dereferences on error in probe()
Browse files Browse the repository at this point in the history
We can't pass a NULL to input_unregister_device().

Fixes: 2a6cdbd ('HID: wacom: Introduce new 'touch_input' device')

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Dan Carpenter authored and Jiri Kosina committed Jun 26, 2015
1 parent 67db8a8 commit 0fd72ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/hid/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1271,11 +1271,13 @@ static int wacom_register_inputs(struct wacom *wacom)
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:
Expand Down

0 comments on commit 0fd72ff

Please sign in to comment.