diff options
author | Denis Arefev <arefev@swemel.ru> | 2022-11-18 13:42:52 +0300 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2022-11-19 13:00:41 +0300 |
commit | b09b56734fae28be9332021ae3e84c9b05020fda (patch) | |
tree | d9e9b5288560df0d49bdd910e81f1737c8387cf4 /drivers/iommu | |
parent | 6cf0981c2233f97d56938d9d61845383d6eb227c (diff) | |
download | linux-b09b56734fae28be9332021ae3e84c9b05020fda.tar.xz |
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>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/amd/iommu_v2.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iommu/amd/iommu_v2.c b/drivers/iommu/amd/iommu_v2.c index 9f7fab49a5a9..864e4ffb6aa9 100644 --- a/drivers/iommu/amd/iommu_v2.c +++ b/drivers/iommu/amd/iommu_v2.c @@ -640,7 +640,9 @@ int amd_iommu_bind_pasid(struct pci_dev *pdev, u32 pasid, if (pasid_state->mm == NULL) goto out_free; - mmu_notifier_register(&pasid_state->mn, mm); + ret = mmu_notifier_register(&pasid_state->mn, mm); + if (ret) + goto out_free; ret = set_pasid_state(dev_state, pasid_state, pasid); if (ret) |