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

Commit 81afe2c0 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mhi: core: Free firmware memory at the end of mhi_fw_load_handler"

parents 0afd1df8 c0bfc78f
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -609,12 +609,9 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl)
	ret = mhi_fw_load_sbl(mhi_cntrl, dma_addr, size);
	mhi_free_coherent(mhi_cntrl, size, buf, dma_addr);

	if (!mhi_cntrl->fbc_download || ret || mhi_cntrl->ee == MHI_EE_EDL)
		release_firmware(firmware);

	/* error or in edl, we're done */
	if (ret || mhi_cntrl->ee == MHI_EE_EDL)
		return;
		goto release_fw;

	write_lock_irq(&mhi_cntrl->pm_lock);
	mhi_cntrl->dev_state = MHI_STATE_RESET;
@@ -629,7 +626,7 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl)
					   firmware->size);
		if (ret) {
			MHI_CNTRL_ERR("Error alloc size:%zu\n", firmware->size);
			goto error_alloc_fw_table;
			goto release_fw;
		}

		MHI_CNTRL_LOG("Copying firmware image into vector table\n");
@@ -648,7 +645,7 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl)
			TO_MHI_EXEC_STR(mhi_cntrl->ee), ret);

	if (!mhi_cntrl->fbc_download)
		return;
		goto release_fw;

	if (ret) {
		MHI_CNTRL_ERR("Did not transition to READY state\n");
@@ -682,7 +679,7 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl)
	mhi_free_bhie_table(mhi_cntrl, mhi_cntrl->fbc_image);
	mhi_cntrl->fbc_image = NULL;

error_alloc_fw_table:
release_fw:
	release_firmware(firmware);
}