diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-04-25 09:42:42 +0100 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-04-25 09:42:42 +0100 |
| commit | a126f7c41d80322b42ae0383ed3dcb17ee0296fc (patch) | |
| tree | 67f3605e72e01f7ec0b15af22d9d7b6ef8598b55 /fs/pipe.c | |
| parent | 0098fc39e6d575f940487f09f303787efbc7a373 (diff) | |
| parent | a7eb7c6f9a657a01a8359edae31bbeacd18b072c (diff) | |
Merge branch 'mcpm' of git://git.linaro.org/people/nico/linux into devel-stable
Diffstat (limited to 'fs/pipe.c')
| -rw-r--r-- | fs/pipe.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/pipe.c b/fs/pipe.c index 64a494cef0a0..2234f3f61f8d 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -863,6 +863,9 @@ pipe_rdwr_open(struct inode *inode, struct file *filp) { int ret = -ENOENT; + if (!(filp->f_mode & (FMODE_READ|FMODE_WRITE))) + return -EINVAL; + mutex_lock(&inode->i_mutex); if (inode->i_pipe) { |
