summaryrefslogtreecommitdiff
path: root/drivers/hid/wacom_sys.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-06-24 17:27:43 +0300
committerJiri Kosina <jkosina@suse.cz>2015-06-26 15:07:45 +0300
commit0fd72ff92d6bea32bba612744abbe6a0abd25e43 (patch)
treeb72ae44db2ca1bfad59a1e968955cb66ae5096fd /drivers/hid/wacom_sys.c
parent67db8a8086e9b865533348954f5547f1e433101e (diff)
downloadlinux-0fd72ff92d6bea32bba612744abbe6a0abd25e43.tar.xz
HID: wacom: NULL dereferences on error in probe()
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> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/wacom_sys.c')
-rw-r--r--drivers/hid/wacom_sys.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 4c0ffca97bef..44958d79d598 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: