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

Commit d88d6bba authored by Yang Yingliang's avatar Yang Yingliang Committed by Greg Kroah-Hartman
Browse files

ARM: imx: add missing iounmap()



[ Upstream commit f9613aa07f16d6042e74208d1b40a6104d72964a ]

Commit e76bdfd7 ("ARM: imx: Added perf functionality to mmdc driver")
introduced imx_mmdc_remove(), the mmdc_base need be unmapped in it if
config PERF_EVENTS is enabled.

If imx_mmdc_perf_init() fails, the mmdc_base also need be unmapped.

Fixes: e76bdfd7 ("ARM: imx: Added perf functionality to mmdc driver")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6c629cd0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -462,6 +462,7 @@ static int imx_mmdc_remove(struct platform_device *pdev)

	cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
	perf_pmu_unregister(&pmu_mmdc->pmu);
	iounmap(pmu_mmdc->mmdc_base);
	kfree(pmu_mmdc);
	return 0;
}
@@ -567,7 +568,11 @@ static int imx_mmdc_probe(struct platform_device *pdev)
	val &= ~(1 << BP_MMDC_MAPSR_PSD);
	writel_relaxed(val, reg);

	return imx_mmdc_perf_init(pdev, mmdc_base);
	err = imx_mmdc_perf_init(pdev, mmdc_base);
	if (err)
		iounmap(mmdc_base);

	return err;
}

int imx_mmdc_get_ddr_type(void)