commit 393b8509be33 (bcache: rework error unwinding in register_bcache)
introduced compile warning: warning: 'sb_page' may be used uninitialized in this function [-Wmaybe-uninitialized]
Use 'sb_page' initialization prior to 393b8509be33.
Fixes: 393b8509be33 (bcache: rework error unwinding in register_bcache) Cc: stable@vger.kernel.org # 5.4.x Signed-off-by: Tom Saeger tom.saeger@oracle.com ---
This addresses warning only seen in 5.4.22+. Upstream avoids this in a different way.
Compile test case:
cp arch/arm64/configs/defconfig .config ./scripts/config -e BCACHE make ARCH=arm64 olddefconfig make ARCH=arm64 -j $(nproc)
Regards, --Tom
drivers/md/bcache/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 658b0f4a01f5..25cbc9e2f8e3 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -2376,7 +2376,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr, char *path = NULL; struct cache_sb *sb; struct block_device *bdev = NULL; - struct page *sb_page; + struct page *sb_page = NULL; ssize_t ret;
ret = -EBUSY;