Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <paul.durrant@citrix.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

authored by

Paul Durrant and committed by
Boris Ostrovsky
dc9eab6f fd8aa909

+1 -2
+1 -2
drivers/xen/privcmd.c
··· 551 551 static long privcmd_ioctl(struct file *file, 552 552 unsigned int cmd, unsigned long data) 553 553 { 554 - int ret = -ENOSYS; 554 + int ret = -ENOTTY; 555 555 void __user *udata = (void __user *) data; 556 556 557 557 switch (cmd) { ··· 572 572 break; 573 573 574 574 default: 575 - ret = -EINVAL; 576 575 break; 577 576 } 578 577