From: Martin Wilck <mwilck@xxxxxxxx> It seems right to try and calculate the dump size properly even in the error case, before allocating the dump buffers. Cc: Joe Carnuccio <joe.carnuccio@xxxxxxxxxx> Cc: Quinn Tran <qutran@xxxxxxxxxxx> Cc: Himanshu Madhani <hmadhani@xxxxxxxxxxx> Cc: Bart Van Assche <bvanassche@xxxxxxx> Signed-off-by: Martin Wilck <mwilck@xxxxxxxx> --- drivers/scsi/qla2xxx/qla_init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index ca9c3f3..8427436 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -3191,7 +3191,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) EFT_SIZE / 1024); ha->eft = NULL; ha->eft_dma = 0; - goto allocate; + goto calc_dump_size; } rval = qla2x00_enable_eft_trace(vha, tc_dma, EFT_NUM_BUFFERS); @@ -3202,7 +3202,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) tc_dma); ha->eft = NULL; ha->eft_dma = 0; - goto allocate; + goto calc_dump_size; } ql_dbg(ql_dbg_init, vha, 0x00c3, "Allocated (%d KB) EFT ...\n", EFT_SIZE / 1024); @@ -3211,6 +3211,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) ha->eft = tc; } +calc_dump_size: if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) { struct fwdt *fwdt = ha->fwdt; uint j; -- 2.22.0