From: Yifan Wu <wuyifan50@huawei.com> driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IDBQ74 ---------------------------------------------------------------------- Fix the order to first call hisi_soc_comp_inst_del to ensure no further operations can be triggered, and then call hisi_soc_l3c_remove_locks to safely release the resources. Fixes: e6ecc3b028b8 ("soc cache: Add framework driver for HiSilicon SoC cache") Signed-off-by: Yifan Wu <wuyifan50@huawei.com> Signed-off-by: Yushan Wang <wangyushan12@huawei.com> Signed-off-by: Hongye Lin <linhongye@h-partners.com> --- drivers/soc/hisilicon/hisi_soc_l3c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/hisilicon/hisi_soc_l3c.c b/drivers/soc/hisilicon/hisi_soc_l3c.c index 258502c09e1b..3e0c6686da0e 100644 --- a/drivers/soc/hisilicon/hisi_soc_l3c.c +++ b/drivers/soc/hisilicon/hisi_soc_l3c.c @@ -504,13 +504,13 @@ static int hisi_soc_l3c_remove(struct platform_device *pdev) unsigned long idx; struct hisi_soc_l3c_lock_region *entry; - hisi_soc_l3c_remove_locks(soc_l3c); - hisi_soc_comp_inst_del(&soc_l3c->comp); cpuhp_state_remove_instance_nocalls(hisi_l3c_cpuhp_state, &soc_l3c->node); + hisi_soc_l3c_remove_locks(soc_l3c); + xa_for_each(&soc_l3c->lock_sets, idx, entry) { entry = xa_erase(&soc_l3c->lock_sets, idx); kfree(entry); -- 2.33.0