From aaa2b4ada9a38beb9443734c56e6dc193ef22e04 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Wed, 26 May 2010 17:54:39 +0200 Subject: [PATCH] --- yaml --- r: 199171 b: refs/heads/master c: cc967be54710d97c05229b2e5ba2d00df84ddd64 h: refs/heads/master i: 199169: 786a1127bd0d6dd1026a3b1924c3a6249026429b 199167: 6c417326ddc34373facf23a5b4c7f6bdd4fa65f8 v: v3 --- [refs] | 2 +- trunk/fs/pipe.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 44308ac4ea85..5d0285d0d9bf 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ea635c64e007061f6468ece5cc9cc62d41d4ecf2 +refs/heads/master: cc967be54710d97c05229b2e5ba2d00df84ddd64 diff --git a/trunk/fs/pipe.c b/trunk/fs/pipe.c index d79872eba09a..60da077400f1 100644 --- a/trunk/fs/pipe.c +++ b/trunk/fs/pipe.c @@ -1169,14 +1169,18 @@ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg) switch (cmd) { case F_SETPIPE_SZ: - if (!capable(CAP_SYS_ADMIN) && arg > pipe_max_pages) - return -EINVAL; + if (!capable(CAP_SYS_ADMIN) && arg > pipe_max_pages) { + ret = -EINVAL; + goto out; + } /* * The pipe needs to be at least 2 pages large to * guarantee POSIX behaviour. */ - if (arg < 2) - return -EINVAL; + if (arg < 2) { + ret = -EINVAL; + goto out; + } ret = pipe_set_size(pipe, arg); break; case F_GETPIPE_SZ: @@ -1187,6 +1191,7 @@ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg) break; } +out: mutex_unlock(&pipe->inode->i_mutex); return ret; }