diff options
Diffstat (limited to 'fs/posix_acl.c')
-rw-r--r-- | fs/posix_acl.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 0855f772cd41..3a48bb789c9f 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 | |||
593 | no_mem_clone: | ||
594 | posix_acl_release(*acl); | ||
595 | no_mem: | ||
596 | posix_acl_release(p); | ||
597 | return -ENOMEM; | ||
594 | } | 598 | } |
595 | EXPORT_SYMBOL_GPL(posix_acl_create); | 599 | EXPORT_SYMBOL_GPL(posix_acl_create); |
596 | 600 | ||
@@ -772,7 +776,7 @@ posix_acl_xattr_get(struct dentry *dentry, const char *name, | |||
772 | 776 | ||
773 | if (!IS_POSIXACL(dentry->d_inode)) | 777 | if (!IS_POSIXACL(dentry->d_inode)) |
774 | return -EOPNOTSUPP; | 778 | return -EOPNOTSUPP; |
775 | if (S_ISLNK(dentry->d_inode->i_mode)) | 779 | if (d_is_symlink(dentry)) |
776 | return -EOPNOTSUPP; | 780 | return -EOPNOTSUPP; |
777 | 781 | ||
778 | acl = get_acl(dentry->d_inode, type); | 782 | acl = get_acl(dentry->d_inode, type); |
@@ -832,7 +836,7 @@ posix_acl_xattr_list(struct dentry *dentry, char *list, size_t list_size, | |||
832 | 836 | ||
833 | if (!IS_POSIXACL(dentry->d_inode)) | 837 | if (!IS_POSIXACL(dentry->d_inode)) |
834 | return -EOPNOTSUPP; | 838 | return -EOPNOTSUPP; |
835 | if (S_ISLNK(dentry->d_inode->i_mode)) | 839 | if (d_is_symlink(dentry)) |
836 | return -EOPNOTSUPP; | 840 | return -EOPNOTSUPP; |
837 | 841 | ||
838 | if (type == ACL_TYPE_ACCESS) | 842 | if (type == ACL_TYPE_ACCESS) |