Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e75bcea authored by Jiri Slaby's avatar Jiri Slaby Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarJiri Slaby <jslaby@suse.cz>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 92d0d66c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -960,7 +960,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;
@@ -1056,7 +1056,7 @@ error:
		free_irq(dev->irq, dev);
	if (dev && dev->hw_io >= 0)
		release_region(dev->hw_io, ENE_IO_SIZE);

error1:
	input_free_device(input_dev);
	kfree(ir_props);
	kfree(dev);