From: Mauro Carvalho Chehab Date: Sun, 11 Feb 2018 10:44:21 +0000 (-0500) Subject: media: dmxdev: fix error code for invalid ioctls X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=07999bccf2e01312bc299c60aca1b18ba83626be;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git media: dmxdev: fix error code for invalid ioctls [ Upstream commit a145f64c6107d3aa5a7cec9f8977d04ac2a896c9 ] 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 Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c index 18e4230865be..51009b2718a3 100644 --- a/drivers/media/dvb-core/dmxdev.c +++ b/drivers/media/dvb-core/dmxdev.c @@ -1055,7 +1055,7 @@ static int dvb_demux_do_ioctl(struct file *file, break; default: - ret = -EINVAL; + ret = -ENOTTY; break; } mutex_unlock(&dmxdev->mutex);