提交 34d7c248 编写于 作者: D Dan Carpenter 提交者: Mauro Carvalho Chehab

[media] em28xx-input: NULL dereference on error

We call "kfree(ir->i2c_client);" in the error handling and that doesn't
work if "ir" is NULL.

Fixes: 78e719a5 ('[media] em28xx-input: i2c IR decoders: improve i2c_client handling')
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NFrank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 1a5cfd02
......@@ -712,8 +712,10 @@ static int em28xx_ir_init(struct em28xx *dev)
em28xx_info("Registering input extension\n");
ir = kzalloc(sizeof(*ir), GFP_KERNEL);
if (!ir)
return -ENOMEM;
rc = rc_allocate_device();
if (!ir || !rc)
if (!rc)
goto error;
/* record handles to ourself */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册