From: Vasant Hegde Date: Thu, 27 Feb 2025 16:23:16 +0000 (+0000) Subject: iommu/amd/pgtbl_v2: Improve error handling X-Git-Tag: v6.15-rc1~163^2^9~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=36a1cfd497435ba5e37572fe9463bb62a7b1b984;p=thirdparty%2Flinux.git iommu/amd/pgtbl_v2: Improve error handling Return -ENOMEM if v2_alloc_pte() fails to allocate memory. Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20250227162320.5805-4-vasant.hegde@amd.com Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/amd/io_pgtable_v2.c b/drivers/iommu/amd/io_pgtable_v2.c index c616de2c5926e..a56a273963059 100644 --- a/drivers/iommu/amd/io_pgtable_v2.c +++ b/drivers/iommu/amd/io_pgtable_v2.c @@ -254,7 +254,7 @@ static int iommu_v2_map_pages(struct io_pgtable_ops *ops, unsigned long iova, pte = v2_alloc_pte(cfg->amd.nid, pgtable->pgd, iova, map_size, gfp, &updated); if (!pte) { - ret = -EINVAL; + ret = -ENOMEM; goto out; }