summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorVasant Hegde <vasant.hegde@amd.com>2025-02-27 16:23:16 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-04 14:40:07 +0200
commit239afef07e3c8fb9ca595ae5f28c0664f1416eab (patch)
tree7c4f694dc97812c5d4eb3f9233b7b2461b01c79b /drivers/iommu
parent64e88f718e7e66c5ce8be7cc1aa440f188571464 (diff)
downloadlinux-239afef07e3c8fb9ca595ae5f28c0664f1416eab.tar.gz
linux-239afef07e3c8fb9ca595ae5f28c0664f1416eab.tar.bz2
linux-239afef07e3c8fb9ca595ae5f28c0664f1416eab.zip
iommu/amd/pgtbl_v2: Improve error handling
[ Upstream commit 36a1cfd497435ba5e37572fe9463bb62a7b1b984 ] Return -ENOMEM if v2_alloc_pte() fails to allocate memory. Signed-off-by: Vasant Hegde <vasant.hegde@amd.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/20250227162320.5805-4-vasant.hegde@amd.com Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/amd/io_pgtable_v2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/amd/io_pgtable_v2.c b/drivers/iommu/amd/io_pgtable_v2.c
index 232d17bd941f..c86cbbc21e88 100644
--- a/drivers/iommu/amd/io_pgtable_v2.c
+++ b/drivers/iommu/amd/io_pgtable_v2.c
@@ -264,7 +264,7 @@ static int iommu_v2_map_pages(struct io_pgtable_ops *ops, unsigned long iova,
map_size = get_alloc_page_size(pgsize);
pte = v2_alloc_pte(pdom->iop.pgd, iova, map_size, &updated);
if (!pte) {
- ret = -EINVAL;
+ ret = -ENOMEM;
goto out;
}