• Martin Wilck's avatar
    scsi: qla2xxx: cleanup trace buffer initialization · 3cf92f4b
    Martin Wilck authored
    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: ad0a0b01 ("scsi: qla2xxx: Fix Firmware dump size for Extended login and Exchange Offload")
    Fixes: a28d9e4e ("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: default avatarMartin Wilck <mwilck@suse.com>
    Tested-by: default avatarHimanshu Madhani <hmadhani@marvell.com>
    Reviewed-by: default avatarHimanshu Madhani <hmadhani@marvell.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    3cf92f4b
qla_init.c 234 KB