diff mbox

[1/2] drivers/media/IR/ene_ir.c: fix NULL dereference

Message ID 201010012113.o91LDeMi020977@imap1.linux-foundation.org (mailing list archive)
State Accepted
Headers show

Commit Message

Andrew Morton Oct. 1, 2010, 9:13 p.m. UTC
None
diff mbox

Patch

diff -puN drivers/media/IR/ene_ir.c~drivers-media-ir-ene_irc-fix-null-dereference drivers/media/IR/ene_ir.c
--- a/drivers/media/IR/ene_ir.c~drivers-media-ir-ene_irc-fix-null-dereference
+++ a/drivers/media/IR/ene_ir.c
@@ -785,7 +785,7 @@  static int ene_probe(struct pnp_dev *pnp
 	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);