Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2b83457bded19cb57c5bdd59ebe16fe1a919c088 Commit: 2b83457bded19cb57c5bdd59ebe16fe1a919c088 Parent: 058250a0d5886b4d96a195ecc7e3a75e2df5e4b1 Author: Steve French <[EMAIL PROTECTED]> AuthorDate: Sun Nov 25 10:01:00 2007 +0000 Committer: Steve French <[EMAIL PROTECTED]> CommitDate: Sun Nov 25 10:01:00 2007 +0000
[CIFS] Fix check after use error in ACL code Spotted by the coverity scanner. CC: Adrian Bunk <[EMAIL PROTECTED]> Signed-off-by: Steve French <[EMAIL PROTECTED]> --- fs/cifs/cifsacl.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index dabbce0..f02fdef 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c @@ -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")); @@ -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); - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html