HID: wacom: NULL dereferences on error in probe()

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

Fixes: 2a6cdbdd4c ('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>
This commit is contained in:
Dan Carpenter 2015-06-24 17:27:43 +03:00 committed by Jiri Kosina
parent 67db8a8086
commit 0fd72ff92d

View file

@ -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: