[PATCH 5.3 148/180] scsi: qla2xxx: Check secondary image if reading the primary image fails
From: Greg Kroah-Hartman
Date: Mon Dec 16 2019 - 13:13:11 EST
From: Bart Van Assche <bvanassche@xxxxxxx>
[ Upstream commit 0597fe601a3a7d103c35b922046251906e0349b3 ]
This patch fixes several Coverity complaints about reading data that has
not been initialized.
Cc: Himanshu Madhani <hmadhani@xxxxxxxxxxx>
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
Tested-by: Himanshu Madhani <hmadhani@xxxxxxxxxxx>
Reviewed-by: Himanshu Madhani <hmadhani@xxxxxxxxxxx>
Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/scsi/qla2xxx/qla_init.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 2f39ed9c66d64..bcd3411fc6be8 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -7624,8 +7624,12 @@ qla27xx_get_active_image(struct scsi_qla_host *vha,
goto check_sec_image;
}
- qla24xx_read_flash_data(vha, (void *)(&pri_image_status),
- ha->flt_region_img_status_pri, sizeof(pri_image_status) >> 2);
+ if (qla24xx_read_flash_data(vha, (void *)(&pri_image_status),
+ ha->flt_region_img_status_pri, sizeof(pri_image_status) >> 2) !=
+ QLA_SUCCESS) {
+ WARN_ON_ONCE(true);
+ goto check_sec_image;
+ }
qla27xx_print_image(vha, "Primary image", &pri_image_status);
if (qla27xx_check_image_status_signature(&pri_image_status)) {
--
2.20.1