diff options
Diffstat (limited to 'fs/smb/client/cifsfs.c')
| -rw-r--r-- | fs/smb/client/cifsfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c index 1d4958ff4d4a..6eccb9ed9daa 100644 --- a/fs/smb/client/cifsfs.c +++ b/fs/smb/client/cifsfs.c @@ -1149,6 +1149,9 @@ cifs_setlease(struct file *file, int arg, struct file_lease **lease, void **priv struct inode *inode = file_inode(file); struct cifsFileInfo *cfile = file->private_data; + if (!S_ISREG(inode->i_mode)) + return -EINVAL; + /* Check if file is oplocked if this is request for new lease */ if (arg == F_UNLCK || ((arg == F_RDLCK) && CIFS_CACHE_READ(CIFS_I(inode))) || |