Commit 0fd72ff9 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jiri Kosina

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

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

Fixes: 2a6cdbdd ('HID: wacom: Introduce new 'touch_input' device')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 67db8a80
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment