aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-08-12 03:47:07 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-09-27 21:21:46 -0400
commit028816bc85db5ac6a562c2aff2113c7480d67919 (patch)
treeb3c2bde2704014eb2bb5c13ceb6aaa70dca21d0b /drivers/media
parent590a58d18027b18db78f538aca592c2cdb249079 (diff)
V4L/DVB: IR: ir-raw-event: null pointer dereference
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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/IR/ir-raw-event.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/IR/ir-raw-event.c b/drivers/media/IR/ir-raw-event.c
index 43094e7eccfa..8e0e1b1f8c87 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)
279 "rc%u", (unsigned int)ir->devno); 279 "rc%u", (unsigned int)ir->devno);
280 280
281 if (IS_ERR(ir->raw->thread)) { 281 if (IS_ERR(ir->raw->thread)) {
282 int ret = PTR_ERR(ir->raw->thread);
283
282 kfree(ir->raw); 284 kfree(ir->raw);
283 ir->raw = NULL; 285 ir->raw = NULL;
284 return PTR_ERR(ir->raw->thread); 286 return ret;
285 } 287 }
286 288
287 mutex_lock(&ir_raw_handler_lock); 289 mutex_lock(&ir_raw_handler_lock);