diff options
author | Paul Durrant <paul.durrant@citrix.com> | 2017-02-13 12:03:22 -0500 |
---|---|---|
committer | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2017-02-13 13:49:00 -0500 |
commit | dc9eab6fd94dd26340749321bba2c58634761516 (patch) | |
tree | f8c05ab25635c57dc168172b4307f7ae0bab7fe9 | |
parent | fd8aa9095a95c02dcc35540a263267c29b8fda9d (diff) |
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>
-rw-r--r-- | drivers/xen/privcmd.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index 6e3306f4a525..5e5c7aef0c9f 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c | |||
@@ -551,7 +551,7 @@ out_unlock: | |||
551 | static long privcmd_ioctl(struct file *file, | 551 | static long privcmd_ioctl(struct file *file, |
552 | unsigned int cmd, unsigned long data) | 552 | unsigned int cmd, unsigned long data) |
553 | { | 553 | { |
554 | int ret = -ENOSYS; | 554 | int ret = -ENOTTY; |
555 | void __user *udata = (void __user *) data; | 555 | void __user *udata = (void __user *) data; |
556 | 556 | ||
557 | switch (cmd) { | 557 | switch (cmd) { |
@@ -572,7 +572,6 @@ static long privcmd_ioctl(struct file *file, | |||
572 | break; | 572 | break; |
573 | 573 | ||
574 | default: | 574 | default: |
575 | ret = -EINVAL; | ||
576 | break; | 575 | break; |
577 | } | 576 | } |
578 | 577 | ||