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 коммит произвёл Jiri Kosina
Родитель 67db8a8086
Коммит 0fd72ff92d
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -1271,10 +1271,12 @@ fail_leds:
pad_input_dev = NULL;
wacom_wac->pad_registered = false;
fail_register_pad_input:
if (touch_input_dev)
input_unregister_device(touch_input_dev);
wacom_wac->touch_input = NULL;
wacom_wac->touch_registered = false;
fail_register_touch_input:
if (pen_input_dev)
input_unregister_device(pen_input_dev);
wacom_wac->pen_input = NULL;
wacom_wac->pen_registered = false;