bcachefs: Fix uninitialized field in hash_check_init()
authorJustin Husted <sigstop@gmail.com>
Mon, 4 Nov 2019 05:50:32 +0000 (21:50 -0800)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:31 +0000 (17:08 -0400)
The chain_end field was not initialized before use in
hash_set_chain_start.

Signed-off-by: Justin Husted <sigstop@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fsck.c

index 5acf1fb645430e3fffa98cc984a46b3c30210e74..3cced2b99f3f14a3ed3ee0688df7d98797a134bf 100644 (file)
@@ -147,6 +147,7 @@ struct hash_check {
 static void hash_check_init(struct hash_check *h)
 {
        h->chain = NULL;
+       h->chain_end = 0;
 }
 
 static void hash_stop_chain(struct btree_trans *trans,