diff --git a/drivers/input/touchscreen/egalax_ts_serial.c b/drivers/input/touchscreen/egalax_ts_serial.c index a078c1c2c3f918df89f54bc635d34e701add5160..657bbae608c8d1f5eb3ce78aebf1b3dc5691100a 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) egalax = kzalloc(sizeof(struct egalax), GFP_KERNEL); input_dev = input_allocate_device(); - if (!egalax) { + if (!egalax || !input_dev) { error = -ENOMEM; goto err_free_mem; }