OSDN Git Service

scsi: qla2xxx: Make qlt_handle_abts_completion() more robust
authorBart Van Assche <bvanassche@acm.org>
Fri, 9 Aug 2019 03:02:07 +0000 (20:02 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 13 Aug 2019 01:34:08 +0000 (21:34 -0400)
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>
drivers/scsi/qla2xxx/qla_target.c

index d25c3fa..cc0c99b 100644 (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);
        }
 }