From: Jarod Wilson Date: Fri, 17 Sep 2010 21:12:31 +0000 (-0300) Subject: V4L/DVB: IR/lirc_dev: check for valid irctl in unregister path X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=df1868e4ee605444bbb98505126bdfb3519749af;p=linux-beck.git V4L/DVB: IR/lirc_dev: check for valid irctl in unregister path Prompted by Red Hat bugzilla #633023 Signed-off-by: Jarod Wilson Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/IR/lirc_dev.c b/drivers/media/IR/lirc_dev.c index 899891bec352..0572053a7944 100644 --- a/drivers/media/IR/lirc_dev.c +++ b/drivers/media/IR/lirc_dev.c @@ -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);