V4L/DVB: IR/lirc_dev: check for valid irctl in unregister path

Prompted by Red Hat bugzilla #633023

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Jarod Wilson 2010-09-17 18:12:31 -03:00 committed by Mauro Carvalho Chehab
parent 04292fc003
commit df1868e4ee

View File

@ -366,6 +366,11 @@ int lirc_unregister_driver(int minor)
}
ir = irctls[minor];
if (!ir) {
printk(KERN_ERR "lirc_dev: lirc_unregister_driver: "
"failed to get irctl struct for minor %d!", minor);
return -ENOENT;
}
mutex_lock(&lirc_dev_lock);