Make sure 32-bit ioctl handler for <= 2.6.10 kernel doesn't return
authorIan Abbott <abbotti@mev.co.uk>
Wed, 7 Nov 2007 16:18:28 +0000 (16:18 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Wed, 7 Nov 2007 16:18:28 +0000 (16:18 +0000)
-ENOIOCTLCMD.

comedi/comedi_compat32.c

index 89ce85d9f5916a8b5dde2ded4ca41b65eed44d31..eeee4469f53601d341a3a481b26a582b36f1eb6e 100644 (file)
@@ -493,11 +493,17 @@ long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 static int mapped_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg,
                struct file *file)
 {
+       int rc;
+
        /* Make sure we are dealing with a Comedi device. */
        if (imajor(file->f_dentry->d_inode) != COMEDI_MAJOR) {
                return -ENOTTY;
        }
-       return (int)comedi_compat_ioctl(file, cmd, arg);
+       rc = (int)comedi_compat_ioctl(file, cmd, arg);
+       if (rc == -ENOIOCTLCMD) {
+               rc = -ENOTTY;
+       }
+       return rc;
 }
 
 struct ioctl32_map {