[PATCH 5.8 304/633] scsi: target: tcmu: Fix warning: page may be used uninitialized
From: Greg Kroah-Hartman
Date: Tue Oct 27 2020 - 11:11:50 EST
From: John Donnelly <john.p.donnelly@xxxxxxxxxx>
[ Upstream commit 61741d8699e1fc764a309ebd20211bb1cb193110 ]
Corrects drivers/target/target_core_user.c:688:6: warning: 'page' may be
used uninitialized.
Link: https://lore.kernel.org/r/20200924001920.43594-1-john.p.donnelly@xxxxxxxxxx
Fixes: 3c58f737231e ("scsi: target: tcmu: Optimize use of flush_dcache_page")
Cc: Mike Christie <michael.christie@xxxxxxxxxx>
Acked-by: Mike Christie <michael.christie@xxxxxxxxxx>
Signed-off-by: John Donnelly <john.p.donnelly@xxxxxxxxxx>
Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/target/target_core_user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index 0209bc23e631e..13a280c780c39 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -669,7 +669,7 @@ static void scatter_data_area(struct tcmu_dev *udev,
void *from, *to = NULL;
size_t copy_bytes, to_offset, offset;
struct scatterlist *sg;
- struct page *page;
+ struct page *page = NULL;
for_each_sg(data_sg, sg, data_nents, i) {
int sg_remaining = sg->length;
--
2.25.1