perf: marvell: Cancel CN10K DDR PMU hrtimer on device remove

cn10k_ddr_perf_remove() did not cancel the poll hrtimer before returning.
If the device was unbound while perf events were still active the timer
callback could run post-free.

To fix the issue by adding hrtimer_cancel() in remove().

Signed-off-by: Geetha sowjanya <gakula@marvell.com>
Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
Geetha sowjanya 2026-06-01 13:03:18 +05:30 committed by Will Deacon
parent 9b551a2446
commit 7dbcb0268d

View File

@ -1284,6 +1284,12 @@ static void cn10k_ddr_perf_remove(struct platform_device *pdev)
{
struct cn10k_ddr_pmu *ddr_pmu = platform_get_drvdata(pdev);
/*
* Cancel the poll timer before further teardown so the handler
* cannot run after this function returns.
*/
hrtimer_cancel(&ddr_pmu->hrtimer);
cpuhp_state_remove_instance_nocalls(
CPUHP_AP_PERF_ARM_MARVELL_CN10K_DDR_ONLINE,
&ddr_pmu->node);