]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iommu/amd/pgtbl_v2: Improve error handling
authorVasant Hegde <vasant.hegde@amd.com>
Thu, 27 Feb 2025 16:23:16 +0000 (16:23 +0000)
committerJoerg Roedel <jroedel@suse.de>
Mon, 10 Mar 2025 08:27:09 +0000 (09:27 +0100)
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>
drivers/iommu/amd/io_pgtable_v2.c

index c616de2c5926ec837557afdccb76a015e439b939..a56a27396305910775c337674e94d855d4045293 100644 (file)
@@ -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;
                }