提交 8dcb3c76 编写于 作者: D Dan Carpenter 提交者: Dmitry Torokhov

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: 6b0f8f9c ('Input: add eGalaxTouch serial touchscreen driver')
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 daf6cd0c
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册