From: Paul Durrant Date: Mon, 13 Feb 2017 17:03:22 +0000 (+0000) Subject: xen/privcmd: return -ENOTTY for unimplemented IOCTLs X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=dc9eab6fd94dd26340749321bba2c58634761516;p=linux.git xen/privcmd: return -ENOTTY for unimplemented IOCTLs The code sets the default return code to -ENOSYS but then overrides this to -EINVAL in the switch() statement's default case, which is clearly silly. This patch removes the override and sets the default return code to -ENOTTY, which is the conventional return for an unimplemented ioctl. Signed-off-by: Paul Durrant Signed-off-by: Boris Ostrovsky --- diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index 6e3306f4a5250..5e5c7aef0c9fa 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -551,7 +551,7 @@ out_unlock: static long privcmd_ioctl(struct file *file, unsigned int cmd, unsigned long data) { - int ret = -ENOSYS; + int ret = -ENOTTY; void __user *udata = (void __user *) data; switch (cmd) { @@ -572,7 +572,6 @@ static long privcmd_ioctl(struct file *file, break; default: - ret = -EINVAL; break; }