Commit 352a763c authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] Subject: PATCH: fix bogus ioctl return in mtrr

This is fairly self explanatory - ENOIOCTLCMD is an internal code outside
of the -1 to -511 range.  The correct return for an unknown ioctl is
-ENOTTY although some Linux devices return the incorrect -EINVAL result.
Patch-By: default avatarAlan Cox <alan@redhat.com>
OSDL Developer Certificate of Origin 1.0 included herein by reference
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7ee0abe6
...@@ -160,7 +160,7 @@ mtrr_ioctl(struct inode *inode, struct file *file, ...@@ -160,7 +160,7 @@ mtrr_ioctl(struct inode *inode, struct file *file,
switch (cmd) { switch (cmd) {
default: default:
return -ENOIOCTLCMD; return -ENOTTY;
case MTRRIOC_ADD_ENTRY: case MTRRIOC_ADD_ENTRY:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment