diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-12-19 12:22:21 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-12-20 02:44:40 -0500 |
commit | 8dcb3c7628f19192dd568fbee9094a2d4b14b6af (patch) | |
tree | e92e2afc46f46c3c89bf9b3b8928480bb14c4b3e | |
parent | daf6cd0c1829c48cba197bd87d57fc8bf3f65faa (diff) |
Input: egalax_ts_serial - fix potential NULL dereference on error
We didn't check input_allocate_device() for failures so it could lead to
a NULL deref.
Fixes: 6b0f8f9c52ef ('Input: add eGalaxTouch serial touchscreen driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/touchscreen/egalax_ts_serial.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/egalax_ts_serial.c b/drivers/input/touchscreen/egalax_ts_serial.c index a078c1c2c3f9..657bbae608c8 100644 --- a/drivers/input/touchscreen/egalax_ts_serial.c +++ b/drivers/input/touchscreen/egalax_ts_serial.c | |||
@@ -105,7 +105,7 @@ static int egalax_connect(struct serio *serio, struct serio_driver *drv) | |||
105 | 105 | ||
106 | egalax = kzalloc(sizeof(struct egalax), GFP_KERNEL); | 106 | egalax = kzalloc(sizeof(struct egalax), GFP_KERNEL); |
107 | input_dev = input_allocate_device(); | 107 | input_dev = input_allocate_device(); |
108 | if (!egalax) { | 108 | if (!egalax || !input_dev) { |
109 | error = -ENOMEM; | 109 | error = -ENOMEM; |
110 | goto err_free_mem; | 110 | goto err_free_mem; |
111 | } | 111 | } |