Skip to content

Commit

Permalink
scsi: qla2xxx: Check secondary image if reading the primary image fails
Browse files Browse the repository at this point in the history
This patch fixes several Coverity complaints about reading data that has
not been initialized.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Bart Van Assche authored and Martin K. Petersen committed Aug 13, 2019
1 parent c43e783 commit 0597fe6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/scsi/qla2xxx/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -7562,8 +7562,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)) {
Expand Down

0 comments on commit 0597fe6

Please sign in to comment.