[1/2] bcachefs: acl: Uninitialized variable in bch2_acl_chmod()

Message ID ce3a4798-f467-4776-939b-b094c365cc5c@moroto.mountain
State New
Headers
Series [1/2] bcachefs: acl: Uninitialized variable in bch2_acl_chmod() |

Commit Message

Dan Carpenter Sept. 15, 2023, 12:55 p.m. UTC
  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>
---
 fs/bcachefs/acl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Kent Overstreet Sept. 19, 2023, 8:57 p.m. UTC | #1
On Fri, Sep 15, 2023 at 03:55:40PM +0300, Dan Carpenter wrote:
> 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>

Thanks, applied
  

Patch

diff --git a/fs/bcachefs/acl.c b/fs/bcachefs/acl.c
index 9653401957b3..6b1579e96dfe 100644
--- a/fs/bcachefs/acl.c
+++ b/fs/bcachefs/acl.c
@@ -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;