All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] MEDIA: ere_ir, fix NULL dereference
@ 2010-09-04 12:24 Jiri Slaby
  0 siblings, 0 replies; only message in thread
From: Jiri Slaby @ 2010-09-04 12:24 UTC (permalink / raw)
  To: mchehab; +Cc: linux-kernel, jirislaby, Maxim Levitsky

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>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/IR/ene_ir.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/IR/ene_ir.c b/drivers/media/IR/ene_ir.c
index 5447750..b475030 100644
--- a/drivers/media/IR/ene_ir.c
+++ b/drivers/media/IR/ene_ir.c
@@ -785,7 +785,7 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
 	dev = kzalloc(sizeof(struct ene_device), GFP_KERNEL);
 
 	if (!input_dev || !ir_props || !dev)
-		goto error;
+		goto error1;
 
 	/* validate resources */
 	error = -ENODEV;
@@ -899,7 +899,7 @@ error:
 		free_irq(dev->irq, dev);
 	if (dev->hw_io)
 		release_region(dev->hw_io, ENE_MAX_IO);
-
+error1:
 	input_free_device(input_dev);
 	kfree(ir_props);
 	kfree(dev);
-- 
1.7.2.2



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-09-04 12:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-04 12:24 [PATCH 1/1] MEDIA: ere_ir, fix NULL dereference Jiri Slaby

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.