From: Jiri Slaby <jslaby@xxxxxxx> 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@xxxxxxx> Cc: Maxim Levitsky <maximlevitsky@xxxxxxxxx> Cc: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/media/IR/ene_ir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); _ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html