Message ID | 20221117023619.9565-1-niejianglei2021@163.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | scsi: lpfc: Fix potential memory leak in lpfcdiag_sli3_loop_post_rxbufs() | expand |
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index 852b025e2fec..2693def758b7 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c @@ -2989,8 +2989,11 @@ static int lpfcdiag_sli3_loop_post_rxbufs(struct lpfc_hba *phba, uint16_t rxxri, err_post_rxbufs_exit: if (rxbmp) { - if (rxbmp->virt) + if (rxbmp->virt) { + if (rxbuffer != NULL) + diag_cmd_data_free(phba, rxbuffer); lpfc_mbuf_free(phba, rxbmp->virt, rxbmp->phys); + } kfree(rxbmp); }