]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: dmxdev: fix error code for invalid ioctls
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 11 Feb 2018 10:44:21 +0000 (05:44 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 23 Feb 2018 10:23:04 +0000 (05:23 -0500)
Returning -EINVAL when an ioctl is not implemented is a very
bad idea, as it is hard to distinguish from other error
contitions that an ioctl could lead. Replace it by its
right error code: -ENOTTY.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-core/dmxdev.c

index c3054101c234778702b9ebe9698738806d04cd0d..d87b69b86a59a8c7655fb287acf9d899a5b8cdbf 100644 (file)
@@ -1160,7 +1160,7 @@ static int dvb_demux_do_ioctl(struct file *file,
                break;
 #endif
        default:
-               ret = -EINVAL;
+               ret = -ENOTTY;
                break;
        }
        mutex_unlock(&dmxdev->mutex);