Skip to content

Commit b09b567

Browse files
Denis Arefevjoergroedel
authored andcommitted
iommu/amd: Check return value of mmu_notifier_register()
Аdded a return value check for the function mmu_notifier_register(). Return value of a function 'mmu_notifier_register' called at iommu_v2.c:642 is not checked, but it is usually checked for this function Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Denis Arefev <arefev@swemel.ru> Link: https://lore.kernel.org/r/20221118104252.122809-1-arefev@swemel.ru [joro: Fix commit message ] Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 6cf0981 commit b09b567

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/iommu/amd/iommu_v2.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,9 @@ int amd_iommu_bind_pasid(struct pci_dev *pdev, u32 pasid,
640640
if (pasid_state->mm == NULL)
641641
goto out_free;
642642

643-
mmu_notifier_register(&pasid_state->mn, mm);
643+
ret = mmu_notifier_register(&pasid_state->mn, mm);
644+
if (ret)
645+
goto out_free;
644646

645647
ret = set_pasid_state(dev_state, pasid_state, pasid);
646648
if (ret)

0 commit comments

Comments
 (0)