summaryrefslogtreecommitdiff
path: root/drivers/media/IR/lirc_dev.c
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2010-10-09 15:07:06 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 01:18:36 -0200
commit8be292cc035ebc3422f08e84682626dd8ed8334b (patch)
treed9dee450677123f2f93a4dd7edb9d127d236c7e3 /drivers/media/IR/lirc_dev.c
parenta126681810a327bee60a58ac5ad77f4518cf7a5f (diff)
downloadlwn-8be292cc035ebc3422f08e84682626dd8ed8334b.tar.gz
lwn-8be292cc035ebc3422f08e84682626dd8ed8334b.zip
[media] lirc: wire up .compat_ioctl to main ioctl handler
As pointed out (and tested) by Joris van Rantwijk, we do actually need to wire up .compat_ioctl for 32-bit lirc userspace to work with 64-bit lirc kernelspace. Do it. And add a check to make sure we get a valid irctl in the ioctl handler. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR/lirc_dev.c')
-rw-r--r--drivers/media/IR/lirc_dev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/IR/lirc_dev.c b/drivers/media/IR/lirc_dev.c
index e4e4d99725e6..c20cfd1d5557 100644
--- a/drivers/media/IR/lirc_dev.c
+++ b/drivers/media/IR/lirc_dev.c
@@ -161,6 +161,9 @@ static struct file_operations fops = {
.write = lirc_dev_fop_write,
.poll = lirc_dev_fop_poll,
.unlocked_ioctl = lirc_dev_fop_ioctl,
+#ifdef CONFIG_COMPAT
+ .compat_ioctl = lirc_dev_fop_ioctl,
+#endif
.open = lirc_dev_fop_open,
.release = lirc_dev_fop_close,
};
@@ -528,6 +531,11 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
int result = 0;
struct irctl *ir = file->private_data;
+ if (!ir) {
+ printk(KERN_ERR "lirc_dev: %s: no irctl found!\n", __func__);
+ return -ENODEV;
+ }
+
dev_dbg(ir->d.dev, LOGHEAD "ioctl called (0x%x)\n",
ir->d.name, ir->d.minor, cmd);