mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
iommu/arm-smmu: fix null-pointer dereference in arm_smmu_add_device
Commit c54451a "iommu/arm-smmu: Fix the error path in arm_smmu_add_device"
removed fwspec assignment in legacy_binding path as redundant which is
wrong. It needs to be updated after fwspec initialisation in
arm_smmu_register_legacy_master() as it is dereferenced later. Without
this there is a NULL-pointer dereference panic during boot on some hosts.
Signed-off-by: Artem Savkov <[email protected]>
Reviewed-by: Robin Murphy <[email protected]>
Acked-by: Will Deacon <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
This commit is contained in:
parent
74ddda71f4
commit
a7990c647b
1 changed files with 7 additions and 0 deletions
|
|
@ -1519,6 +1519,13 @@ static int arm_smmu_add_device(struct device *dev)
|
|||
|
||||
if (using_legacy_binding) {
|
||||
ret = arm_smmu_register_legacy_master(dev, &smmu);
|
||||
|
||||
/*
|
||||
* If dev->iommu_fwspec is initally NULL, arm_smmu_register_legacy_master()
|
||||
* will allocate/initialise a new one. Thus we need to update fwspec for
|
||||
* later use.
|
||||
*/
|
||||
fwspec = dev->iommu_fwspec;
|
||||
if (ret)
|
||||
goto out_free;
|
||||
} else if (fwspec && fwspec->ops == &arm_smmu_ops) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue