aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/em28xx
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-09-25 07:39:41 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-10-24 07:28:12 -0400
commit34d7c248ad28c5d462182c5063523023604efc12 (patch)
treec1fbd7d5199d0fbbdfaa9cbf3673fc67da486600 /drivers/media/usb/em28xx
parent1a5cfd022774a1ff8517f8f2f2da4013ef7c2e4d (diff)
[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: 78e719a5f30b ('[media] em28xx-input: i2c IR decoders: improve i2c_client handling') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/em28xx')
-rw-r--r--drivers/media/usb/em28xx/em28xx-input.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index 581f6dad4ca9..23f8f6afa2e0 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -712,8 +712,10 @@ static int em28xx_ir_init(struct em28xx *dev)
712 em28xx_info("Registering input extension\n"); 712 em28xx_info("Registering input extension\n");
713 713
714 ir = kzalloc(sizeof(*ir), GFP_KERNEL); 714 ir = kzalloc(sizeof(*ir), GFP_KERNEL);
715 if (!ir)
716 return -ENOMEM;
715 rc = rc_allocate_device(); 717 rc = rc_allocate_device();
716 if (!ir || !rc) 718 if (!rc)
717 goto error; 719 goto error;
718 720
719 /* record handles to ourself */ 721 /* record handles to ourself */