diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-04-24 06:47:51 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-04-24 06:47:50 -0700 |
| commit | 5e10c8152d6dc63b50085300fe70735524b36e2d (patch) | |
| tree | 923bce399b2a8f004b8a9a39644f9dbdcf1c506c /fs | |
| parent | 22efcf6c1344e0b0797135fea1ca01419867b9d2 (diff) | |
| parent | 1cfb2113468a2d82c28c596bfa271c9dea2a4c5e (diff) | |
Merge "ANDROID: fix acl leaks"
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/gfs2/acl.c | 5 | ||||
| -rw-r--r-- | fs/xfs/xfs_acl.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c index ff0ac96a8e7b..db4c867369b5 100644 --- a/fs/gfs2/acl.c +++ b/fs/gfs2/acl.c @@ -78,8 +78,11 @@ int gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type) if (type == ACL_TYPE_ACCESS) { umode_t mode = inode->i_mode; - + struct posix_acl *old_acl = acl; error = posix_acl_update_mode(inode, &inode->i_mode, &acl); + + if (!acl) + posix_acl_release(old_acl); if (error) return error; if (mode != inode->i_mode) diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c index c5101a3295d8..62ba66e1c598 100644 --- a/fs/xfs/xfs_acl.c +++ b/fs/xfs/xfs_acl.c @@ -289,8 +289,10 @@ xfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) if (type == ACL_TYPE_ACCESS) { umode_t mode; - + struct posix_acl *old_acl = acl; error = posix_acl_update_mode(inode, &mode, &acl); + if (!acl) + posix_acl_release(old_acl); if (error) return error; error = xfs_set_mode(inode, mode); |
