On 8/13/19 10:31 PM, Martin Wilck wrote: > 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; > Reviewed-by: Hannes Reinecke <hare@xxxxxxxx> Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@xxxxxxx +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)