On Tue, Feb 12, 2019 at 6:58 PM Frank Li <frank.li@xxxxxxx> wrote: > +static int ddr_perf_remove(struct platform_device *pdev) > +{ > + struct ddr_pmu *pmu = platform_get_drvdata(pdev); > + > + cpuhp_state_remove_instance_nocalls(pmu->cpuhp_state, &pmu->node); > + perf_pmu_unregister(&pmu->pmu); > + kfree(pmu); Since you allocated pmu via devm_kzalloc(), there is no need to call kfree() here.