Skip to content

Commit

Permalink
iommu/amd/pgtbl_v2: Improve error handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vasant Hegde authored and Joerg Roedel committed Mar 10, 2025
1 parent e481f8a commit 36a1cfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/amd/io_pgtable_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 36a1cfd

Please sign in to comment.