]> git.itanic.dy.fi Git - linux-stable/commitdiff
bcachefs: acl: Uninitialized variable in bch2_acl_chmod()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 15 Sep 2023 12:55:40 +0000 (15:55 +0300)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:14 +0000 (17:10 -0400)
The clean up code at the end of the function uses "acl" so it needs
to be initialized to NULL.

Fixes: 53306e096d91 ("bcachefs: Always check for transaction restarts")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/acl.c

index 9653401957b322863d003b59c1f97f60343742dd..6b1579e96dfe16252e3c99e2903986cab5a77bdf 100644 (file)
@@ -417,7 +417,7 @@ int bch2_acl_chmod(struct btree_trans *trans, subvol_inum inum,
        struct btree_iter iter;
        struct bkey_s_c_xattr xattr;
        struct bkey_i_xattr *new;
-       struct posix_acl *acl;
+       struct posix_acl *acl = NULL;
        struct bkey_s_c k;
        int ret;