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

Commit 56c447b7 authored by Prakash Gupta's avatar Prakash Gupta
Browse files

iommu: arm-smmu: fix device remove cleanup



smmu devices are added to arm_smmu_devices list during device probe. This
needs to be cleaned up during device remove. In absence of that we can see
list corruption.

register_client_adhoc:Client handle 1 apps_smmu
list_add corruption. next->prev should be prev (ffffff8ee36ed1e8), but was
6b6b6b6b6b6b6b6b. (next=ffffffdf7004a590).
PC is at __list_add+0xd8/0xe0
LR is at __list_add+0xd8/0xe0
__list_add+0xd8/0xe0
arm_smmu_device_dt_probe+0x334/0x1290
platform_drv_probe+0x58/0xd0
driver_probe_device+0x254/0x438
bind_store+0x168/0x1c4
drv_attr_store+0x48/0x5c
sysfs_kf_write+0x5c/0x74
[...]

CRs-Fixed: 2262423
Change-Id: I48dedc44e427f061af86e994756a3e95afdb3ac5
Signed-off-by: default avatarPrakash Gupta <guptap@codeaurora.org>
parent 7af3eef5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4864,6 +4864,10 @@ static int arm_smmu_device_remove(struct platform_device *pdev)

	arm_smmu_exit_power_resources(smmu->pwr);

	spin_lock(&arm_smmu_devices_lock);
	list_del(&smmu->list);
	spin_unlock(&arm_smmu_devices_lock);

	return 0;
}