diff options
author | Will Deacon <will.deacon@arm.com> | 2012-05-31 16:26:10 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 17:49:27 -0700 |
commit | a1d494495c69ef0810cd008f59310d2b9db28e36 (patch) | |
tree | 0785413b25f5383bf736d04169151e6a251dd079 /fs | |
parent | c67e5382fb3f312c95d8d01db40fb398e6da454d (diff) | |
download | linux-stable-a1d494495c69ef0810cd008f59310d2b9db28e36.tar.gz linux-stable-a1d494495c69ef0810cd008f59310d2b9db28e36.tar.bz2 linux-stable-a1d494495c69ef0810cd008f59310d2b9db28e36.zip |
pipe: return -ENOIOCTLCMD instead of -EINVAL on unknown ioctl command
As described in commit 07d106d0a33d ("vfs: fix up ENOIOCTLCMD error
handling"), drivers should return -ENOIOCTLCMD if they receive an ioctl
command which they don't understand. Doing so will result in -ENOTTY
being returned to userspace, which matches the behaviour of the compat
layer if it fails to translate an ioctl command.
This patch fixes the pipe ioctl to return -ENOIOCTLCMD instead of -EINVAL
when passed an unknown ioctl command.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Alan Cox <alan@linux.intel.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/pipe.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/pipe.c b/fs/pipe.c index fec5e4ad071a..95ebb56de494 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -693,7 +693,7 @@ static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) return put_user(count, (int __user *)arg); default: - return -EINVAL; + return -ENOIOCTLCMD; } } |