From: Will Deacon Date: Fri, 25 May 2012 10:39:13 +0000 (+0100) Subject: pipe: return -ENOIOCTLCMD instead of -EINVAL on unknown ioctl command X-Git-Tag: upstream/snapshot3+hdmi~7309^2~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=46ce341b2f176c2611f12ac390adf862e932eb02;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git pipe: return -ENOIOCTLCMD instead of -EINVAL on unknown ioctl command As described in commit 07d106d0a ("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. Cc: Al Viro Cc: Andrew Morton Signed-off-by: Will Deacon Signed-off-by: Al Viro --- diff --git a/fs/pipe.c b/fs/pipe.c index fec5e4a..95ebb56 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; } }