diff options
Diffstat (limited to 'libbcachefs/acl.c')
-rw-r--r-- | libbcachefs/acl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libbcachefs/acl.c b/libbcachefs/acl.c index 74cb188f..5408a922 100644 --- a/libbcachefs/acl.c +++ b/libbcachefs/acl.c @@ -370,7 +370,7 @@ int bch2_acl_chmod(struct btree_trans *trans, acl = bch2_acl_from_disk(xattr_val(xattr.v), le16_to_cpu(xattr.v->x_val_len)); ret = PTR_ERR_OR_ZERO(acl); - if (ret || !acl) + if (IS_ERR_OR_NULL(acl)) goto err; ret = __posix_acl_chmod(&acl, GFP_KERNEL, mode); @@ -389,7 +389,8 @@ int bch2_acl_chmod(struct btree_trans *trans, acl = NULL; err: bch2_trans_iter_put(trans, iter); - kfree(acl); + if (!IS_ERR_OR_NULL(acl)) + kfree(acl); return ret; } |