Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e2bdf7a authored by John Soni Jose's avatar John Soni Jose Committed by James Bottomley
Browse files

be2iscsi : Fix memory leak in the unload path



 Driver was not freeing the DMA memory allocated for EQ/CQ in the
 unload path. This patch frees the DMA memory during the driver unload.

Signed-off-by: default avatarJohn Soni Jose <sony.john-n@emulex.com>
Signed-off-by: default avatarJayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent e307f3ac
Loading
Loading
Loading
Loading
+12 −6
Original line number Original line Diff line number Diff line
@@ -3695,15 +3695,17 @@ static void be_mcc_queues_destroy(struct beiscsi_hba *phba)
	struct be_ctrl_info *ctrl = &phba->ctrl;
	struct be_ctrl_info *ctrl = &phba->ctrl;


	q = &phba->ctrl.mcc_obj.q;
	q = &phba->ctrl.mcc_obj.q;
	if (q->created)
	if (q->created) {
		beiscsi_cmd_q_destroy(ctrl, q, QTYPE_MCCQ);
		beiscsi_cmd_q_destroy(ctrl, q, QTYPE_MCCQ);
		be_queue_free(phba, q);
		be_queue_free(phba, q);
	}


	q = &phba->ctrl.mcc_obj.cq;
	q = &phba->ctrl.mcc_obj.cq;
	if (q->created)
	if (q->created) {
		beiscsi_cmd_q_destroy(ctrl, q, QTYPE_CQ);
		beiscsi_cmd_q_destroy(ctrl, q, QTYPE_CQ);
		be_queue_free(phba, q);
		be_queue_free(phba, q);
	}
	}
}


static void hwi_cleanup(struct beiscsi_hba *phba)
static void hwi_cleanup(struct beiscsi_hba *phba)
{
{
@@ -3746,9 +3748,11 @@ static void hwi_cleanup(struct beiscsi_hba *phba)


	for (i = 0; i < (phba->num_cpus); i++) {
	for (i = 0; i < (phba->num_cpus); i++) {
		q = &phwi_context->be_cq[i];
		q = &phwi_context->be_cq[i];
		if (q->created)
		if (q->created) {
			be_queue_free(phba, q);
			beiscsi_cmd_q_destroy(ctrl, q, QTYPE_CQ);
			beiscsi_cmd_q_destroy(ctrl, q, QTYPE_CQ);
		}
		}
	}


	be_mcc_queues_destroy(phba);
	be_mcc_queues_destroy(phba);
	if (phba->msix_enabled)
	if (phba->msix_enabled)
@@ -3757,9 +3761,11 @@ static void hwi_cleanup(struct beiscsi_hba *phba)
		eq_for_mcc = 0;
		eq_for_mcc = 0;
	for (i = 0; i < (phba->num_cpus + eq_for_mcc); i++) {
	for (i = 0; i < (phba->num_cpus + eq_for_mcc); i++) {
		q = &phwi_context->be_eq[i].q;
		q = &phwi_context->be_eq[i].q;
		if (q->created)
		if (q->created) {
			be_queue_free(phba, q);
			beiscsi_cmd_q_destroy(ctrl, q, QTYPE_EQ);
			beiscsi_cmd_q_destroy(ctrl, q, QTYPE_EQ);
		}
		}
	}
	be_cmd_fw_uninit(ctrl);
	be_cmd_fw_uninit(ctrl);
}
}