Skip to content

Commit 80fea97

Browse files
Aleksandr Aprelkovwilldeacon
authored andcommitted
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>
1 parent d75d7dc commit 80fea97

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3398,7 +3398,7 @@ static void arm_smmu_setup_msis(struct arm_smmu_device *smmu)
33983398
smmu->priq.q.irq = msi_get_virq(dev, PRIQ_MSI_INDEX);
33993399

34003400
/* Add callback to free MSIs on teardown */
3401-
devm_add_action(dev, arm_smmu_free_msis, dev);
3401+
devm_add_action_or_reset(dev, arm_smmu_free_msis, dev);
34023402
}
34033403

34043404
static void arm_smmu_setup_unique_irqs(struct arm_smmu_device *smmu)

0 commit comments

Comments
 (0)