aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-11-25 05:01:00 -0500
committerSteve French <sfrench@us.ibm.com>2007-11-25 05:01:00 -0500
commit2b83457bded19cb57c5bdd59ebe16fe1a919c088 (patch)
tree895ca899567b0ca76c97691af60927ee42d3f338
parent058250a0d5886b4d96a195ecc7e3a75e2df5e4b1 (diff)
[CIFS] Fix check after use error in ACL code
Spotted by the coverity scanner. CC: Adrian Bunk <bunk@kernel.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r--fs/cifs/cifsacl.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index dabbce00712b..f02fdef463a7 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,
269 269
270 /* BB need to add parm so we can store the SID BB */ 270 /* BB need to add parm so we can store the SID BB */
271 271
272 if (!pdacl) {
273 /* no DACL in the security descriptor, set
274 all the permissions for user/group/other */
275 inode->i_mode |= S_IRWXUGO;
276 return;
277 }
278
272 /* validate that we do not go past end of acl */ 279 /* validate that we do not go past end of acl */
273 if (end_of_acl < (char *)pdacl + le16_to_cpu(pdacl->size)) { 280 if (end_of_acl < (char *)pdacl + le16_to_cpu(pdacl->size)) {
274 cERROR(1, ("ACL too small to parse DACL")); 281 cERROR(1, ("ACL too small to parse DACL"));
@@ -286,12 +293,6 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
286 user/group/other have no permissions */ 293 user/group/other have no permissions */
287 inode->i_mode &= ~(S_IRWXUGO); 294 inode->i_mode &= ~(S_IRWXUGO);
288 295
289 if (!pdacl) {
290 /* no DACL in the security descriptor, set
291 all the permissions for user/group/other */
292 inode->i_mode |= S_IRWXUGO;
293 return;
294 }
295 acl_base = (char *)pdacl; 296 acl_base = (char *)pdacl;
296 acl_size = sizeof(struct cifs_acl); 297 acl_size = sizeof(struct cifs_acl);
297 298