aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/pipe.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index 541d6626f9d9..369a0245aab6 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1181,13 +1181,7 @@ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg)
1181 if (!capable(CAP_SYS_ADMIN) && nr_pages > pipe_max_pages) { 1181 if (!capable(CAP_SYS_ADMIN) && nr_pages > pipe_max_pages) {
1182 ret = -EPERM; 1182 ret = -EPERM;
1183 goto out; 1183 goto out;
1184 } 1184 } else if (nr_pages < 1) {
1185
1186 /*
1187 * The pipe needs to be at least 2 pages large to
1188 * guarantee POSIX behaviour.
1189 */
1190 if (arg < 2) {
1191 ret = -EINVAL; 1185 ret = -EINVAL;
1192 goto out; 1186 goto out;
1193 } 1187 }