public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] IR: ir-raw-event: null pointer dereference
@ 2010-08-12  7:47 Dan Carpenter
  2010-08-12 19:36 ` Jarod Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-08-12  7:47 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: David Härdeman, Jarod Wilson, Maxim Levitsky, linux-media,
	kernel-janitors

The original code dereferenced ir->raw after freeing it and setting it
to NULL.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/media/IR/ir-raw-event.c b/drivers/media/IR/ir-raw-event.c
index 43094e7..8e0e1b1 100644
--- a/drivers/media/IR/ir-raw-event.c
+++ b/drivers/media/IR/ir-raw-event.c
@@ -279,9 +279,11 @@ int ir_raw_event_register(struct input_dev *input_dev)
 			"rc%u",  (unsigned int)ir->devno);
 
 	if (IS_ERR(ir->raw->thread)) {
+		int ret = PTR_ERR(ir->raw->thread);
+
 		kfree(ir->raw);
 		ir->raw = NULL;
-		return PTR_ERR(ir->raw->thread);
+		return ret;
 	}
 
 	mutex_lock(&ir_raw_handler_lock);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] IR: ir-raw-event: null pointer dereference
  2010-08-12  7:47 [patch] IR: ir-raw-event: null pointer dereference Dan Carpenter
@ 2010-08-12 19:36 ` Jarod Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Jarod Wilson @ 2010-08-12 19:36 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Mauro Carvalho Chehab, David Härdeman, Maxim Levitsky,
	linux-media, kernel-janitors

----- Dan Carpenter <error27@gmail.com> wrote:
> The original code dereferenced ir->raw after freeing it and setting it
> to NULL.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>


Acked-by: Jarod Wilson <jarod@redhat.com>


-- 
Jarod Wilson
jarod@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-12 19:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-12  7:47 [patch] IR: ir-raw-event: null pointer dereference Dan Carpenter
2010-08-12 19:36 ` Jarod Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox