From df1868e4ee605444bbb98505126bdfb3519749af Mon Sep 17 00:00:00 2001 From: Jarod Wilson Date: Fri, 17 Sep 2010 18:12:31 -0300 Subject: [PATCH] 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 --- drivers/media/IR/lirc_dev.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- GitLab