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>
"rc%u", (unsigned int)ir->devno);
if (IS_ERR(ir->raw->thread)) {
"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;
kfree(ir->raw);
ir->raw = NULL;
- return PTR_ERR(ir->raw->thread);
}
mutex_lock(&ir_raw_handler_lock);
}
mutex_lock(&ir_raw_handler_lock);