Skip to content

Commit

Permalink
[CIFS] Fix check after use error in ACL code
Browse files Browse the repository at this point in the history
Spotted by the coverity scanner.

CC: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
Steve French committed Nov 25, 2007
1 parent 058250a commit 2b83457
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions fs/cifs/cifsacl.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,

/* BB need to add parm so we can store the SID BB */

if (!pdacl) {
/* no DACL in the security descriptor, set
all the permissions for user/group/other */
inode->i_mode |= S_IRWXUGO;
return;
}

/* validate that we do not go past end of acl */
if (end_of_acl < (char *)pdacl + le16_to_cpu(pdacl->size)) {
cERROR(1, ("ACL too small to parse DACL"));
Expand All @@ -286,12 +293,6 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
user/group/other have no permissions */
inode->i_mode &= ~(S_IRWXUGO);

if (!pdacl) {
/* no DACL in the security descriptor, set
all the permissions for user/group/other */
inode->i_mode |= S_IRWXUGO;
return;
}
acl_base = (char *)pdacl;
acl_size = sizeof(struct cifs_acl);

Expand Down

0 comments on commit 2b83457

Please sign in to comment.