aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/IR
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2010-10-01 17:13:40 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 05:54:30 -0400
commit2e75bcea00273146615dbc6ed3bbabce8d0bc1ca (patch)
treefd7b8fddccd6dd0ba61f0448ff23721c5748208c /drivers/media/IR
parent92d0d66c1515c8ee3b700ab3d610587c71fe497f (diff)
[media] drivers/media/IR/ene_ir.c: fix NULL dereference
When 'dev' allocation fails in ene_probe we jump to error label where we dereference the 'dev'. Fix it by jumping few lines below. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR')
-rw-r--r--drivers/media/IR/ene_ir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/IR/ene_ir.c b/drivers/media/IR/ene_ir.c
index 9f9afe7c603e..f5beea04906a 100644
--- a/drivers/media/IR/ene_ir.c
+++ b/drivers/media/IR/ene_ir.c
@@ -960,7 +960,7 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
960 dev = kzalloc(sizeof(struct ene_device), GFP_KERNEL); 960 dev = kzalloc(sizeof(struct ene_device), GFP_KERNEL);
961 961
962 if (!input_dev || !ir_props || !dev) 962 if (!input_dev || !ir_props || !dev)
963 goto error; 963 goto error1;
964 964
965 /* validate resources */ 965 /* validate resources */
966 error = -ENODEV; 966 error = -ENODEV;
@@ -1056,7 +1056,7 @@ error:
1056 free_irq(dev->irq, dev); 1056 free_irq(dev->irq, dev);
1057 if (dev && dev->hw_io >= 0) 1057 if (dev && dev->hw_io >= 0)
1058 release_region(dev->hw_io, ENE_IO_SIZE); 1058 release_region(dev->hw_io, ENE_IO_SIZE);
1059 1059error1:
1060 input_free_device(input_dev); 1060 input_free_device(input_dev);
1061 kfree(ir_props); 1061 kfree(ir_props);
1062 kfree(dev); 1062 kfree(dev);