diff options
-rw-r--r-- | fs/pipe.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -863,6 +863,9 @@ pipe_rdwr_open(struct inode *inode, struct file *filp) | |||
863 | { | 863 | { |
864 | int ret = -ENOENT; | 864 | int ret = -ENOENT; |
865 | 865 | ||
866 | if (!(filp->f_mode & (FMODE_READ|FMODE_WRITE))) | ||
867 | return -EINVAL; | ||
868 | |||
866 | mutex_lock(&inode->i_mutex); | 869 | mutex_lock(&inode->i_mutex); |
867 | 870 | ||
868 | if (inode->i_pipe) { | 871 | if (inode->i_pipe) { |