aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/posix_acl.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index 0855f772cd41..515d31511d0d 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -564,13 +564,11 @@ posix_acl_create(struct inode *dir, umode_t *mode,
564 564
565 *acl = posix_acl_clone(p, GFP_NOFS); 565 *acl = posix_acl_clone(p, GFP_NOFS);
566 if (!*acl) 566 if (!*acl)
567 return -ENOMEM; 567 goto no_mem;
568 568
569 ret = posix_acl_create_masq(*acl, mode); 569 ret = posix_acl_create_masq(*acl, mode);
570 if (ret < 0) { 570 if (ret < 0)
571 posix_acl_release(*acl); 571 goto no_mem_clone;
572 return -ENOMEM;
573 }
574 572
575 if (ret == 0) { 573 if (ret == 0) {
576 posix_acl_release(*acl); 574 posix_acl_release(*acl);
@@ -591,6 +589,12 @@ no_acl:
591 *default_acl = NULL; 589 *default_acl = NULL;
592 *acl = NULL; 590 *acl = NULL;
593 return 0; 591 return 0;
592
593no_mem_clone:
594 posix_acl_release(*acl);
595no_mem:
596 posix_acl_release(p);
597 return -ENOMEM;
594} 598}
595EXPORT_SYMBOL_GPL(posix_acl_create); 599EXPORT_SYMBOL_GPL(posix_acl_create);
596 600