scsi: qla2xxx: cleanup trace buffer initialization
authorMartin Wilck <mwilck@suse.com>
Wed, 14 Aug 2019 13:28:29 +0000 (13:28 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 20 Aug 2019 01:51:00 +0000 (21:51 -0400)
commit3cf92f4bfccbb3e378cd86dc46e09c2bc18cda26
tree09e2ef6de28e504f0382a161e5c4e65a15a9d33c
parentedbd56472a636ab396f5ee6783e8438fa725a6ee
scsi: qla2xxx: cleanup trace buffer initialization

Avoid code duplication between qla2x00_alloc_offload_mem() and
qla2x00_alloc_fw_dump() by moving the FCE and EFT buffer allocation and
initialization to separate functions. Cleanly track failure and success by
making sure that the ha->eft, ha->fce and respective eft_dma, fce_dma
members are set if and only if the buffers are properly allocated and
initialized. Avoid pointless buffer reallocation.  Eliminate some goto
statements. Make sure the fce_enabled flag is cleared when the FCE buffer
is freed.

Fixes: ad0a0b01f088 ("scsi: qla2xxx: Fix Firmware dump size for Extended login and Exchange Offload")
Fixes: a28d9e4ef997 ("scsi: qla2xxx: Add support for multiple fwdump templates/segments")
Cc: Joe Carnuccio <joe.carnuccio@cavium.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_os.c