]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/pipe.c
fsnotify: kill FSNOTIFY_EVENT_FILE
[karo-tx-linux.git] / fs / pipe.c
index f31e2d472984182d8d06ebadc4e66c8dd423b735..279eef96c51cdf28a81d4f0c3d0d702a71dc5a1c 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1215,12 +1215,13 @@ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg)
                size = round_pipe_size(arg);
                nr_pages = size >> PAGE_SHIFT;
 
+               ret = -EINVAL;
+               if (!nr_pages)
+                       goto out;
+
                if (!capable(CAP_SYS_RESOURCE) && size > pipe_max_size) {
                        ret = -EPERM;
                        goto out;
-               } else if (nr_pages < PAGE_SIZE) {
-                       ret = -EINVAL;
-                       goto out;
                }
                ret = pipe_set_size(pipe, nr_pages);
                break;