Skip to content

Commit

Permalink
V4L/DVB: IR: ir-raw-event: null pointer dereference
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed Sep 28, 2010
1 parent 590a58d commit 028816b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/IR/ir-raw-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 028816b

Please sign in to comment.