aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/file.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 71185d1d310a..777e7f42b5b1 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -754,12 +754,6 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
754 754
755 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 755 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
756 tcon = tlink_tcon(((struct cifsFileInfo *)file->private_data)->tlink); 756 tcon = tlink_tcon(((struct cifsFileInfo *)file->private_data)->tlink);
757
758 if (file->private_data == NULL) {
759 rc = -EBADF;
760 FreeXid(xid);
761 return rc;
762 }
763 netfid = ((struct cifsFileInfo *)file->private_data)->netfid; 757 netfid = ((struct cifsFileInfo *)file->private_data)->netfid;
764 758
765 if ((tcon->ses->capabilities & CAP_UNIX) && 759 if ((tcon->ses->capabilities & CAP_UNIX) &&
@@ -1154,7 +1148,7 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
1154 bool fsuid_only) 1148 bool fsuid_only)
1155{ 1149{
1156 struct cifsFileInfo *open_file; 1150 struct cifsFileInfo *open_file;
1157 struct cifs_sb_info *cifs_sb = CIFS_SB(cifs_inode->vfs_inode.i_sb); 1151 struct cifs_sb_info *cifs_sb;
1158 bool any_available = false; 1152 bool any_available = false;
1159 int rc; 1153 int rc;
1160 1154
@@ -1168,6 +1162,8 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
1168 return NULL; 1162 return NULL;
1169 } 1163 }
1170 1164
1165 cifs_sb = CIFS_SB(cifs_inode->vfs_inode.i_sb);
1166
1171 /* only filter by fsuid on multiuser mounts */ 1167 /* only filter by fsuid on multiuser mounts */
1172 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER)) 1168 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER))
1173 fsuid_only = false; 1169 fsuid_only = false;