diff options
author | 2024-04-03 12:37:59 +0700 | |
---|---|---|
committer | 2024-04-18 15:39:39 +0100 | |
commit | 80fea979dd9d48d67c5b48d2f690c5da3e543ebd (patch) | |
tree | a2b4f35ba53132de050bb66dd960645228319b3e | |
parent | iommu/arm-smmu: Convert to domain_alloc_paging() (diff) | |
download | wireguard-linux-80fea979dd9d48d67c5b48d2f690c5da3e543ebd.tar.xz wireguard-linux-80fea979dd9d48d67c5b48d2f690c5da3e543ebd.zip |
iommu/arm-smmu-v3: Free MSIs in case of ENOMEM
If devm_add_action() returns -ENOMEM, then MSIs are allocated but not
not freed on teardown. Use devm_add_action_or_reset() instead to keep
the static analyser happy.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Aleksandr Aprelkov <aaprelkov@usergate.com>
Link: https://lore.kernel.org/r/20240403053759.643164-1-aaprelkov@usergate.com
[will: Tweak commit message, remove warning message]
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 79c18e95dd29..ac7164baa68c 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -3398,7 +3398,7 @@ static void arm_smmu_setup_msis(struct arm_smmu_device *smmu) smmu->priq.q.irq = msi_get_virq(dev, PRIQ_MSI_INDEX); /* Add callback to free MSIs on teardown */ - devm_add_action(dev, arm_smmu_free_msis, dev); + devm_add_action_or_reset(dev, arm_smmu_free_msis, dev); } static void arm_smmu_setup_unique_irqs(struct arm_smmu_device *smmu) |