scsi: qla2xxx: Make qlt_handle_abts_completion() more robust

Avoid that this function crashes if mcmd == NULL.

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>
This commit is contained in:
Bart Van Assche 2019-08-08 20:02:07 -07:00 committed by Martin K. Petersen
parent 85cffefa09
commit e752a04e1b

View File

@ -5731,7 +5731,7 @@ static void qlt_handle_abts_completion(struct scsi_qla_host *vha,
entry->error_subcode2);
ha->tgt.tgt_ops->free_mcmd(mcmd);
}
} else {
} else if (mcmd) {
ha->tgt.tgt_ops->free_mcmd(mcmd);
}
}