bcache: memset on stack variables in bch_btree_check() and bch_sectors_dirty_init()
authorColy Li <colyli@suse.de>
Fri, 27 May 2022 15:28:16 +0000 (23:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 Jul 2022 14:41:12 +0000 (16:41 +0200)
commit1cdcd496b7ca3821df8b8551f1775b53efc934e0
tree313781a321b7d514c99488d7de1be9a03a201f8e
parentedbaf6e5e93acda96aae23ba134ef3c1466da3b5
bcache: memset on stack variables in bch_btree_check() and bch_sectors_dirty_init()

commit 7d6b902ea0e02b2a25c480edf471cbaa4ebe6b3c upstream.

The local variables check_state (in bch_btree_check()) and state (in
bch_sectors_dirty_init()) should be fully filled by 0, because before
allocating them on stack, they were dynamically allocated by kzalloc().

Signed-off-by: Coly Li <colyli@suse.de>
Link: https://lore.kernel.org/r/20220527152818.27545-2-colyli@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/bcache/btree.c
drivers/md/bcache/writeback.c