diff mbox series

VT-d: change bogus return value of intel_iommu_lookup_page()

Message ID 5CDAAECA020000780022E947@prv1-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show
Series VT-d: change bogus return value of intel_iommu_lookup_page() | expand

Commit Message

Jan Beulich May 14, 2019, 12:04 p.m. UTC
The function passes 0 as "alloc" argument to addr_to_dma_page_maddr(),
so -ENOMEM simply makes no sense (and its use was probably simply a
copy-and-paste effect originating at intel_iommu_map_page()).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Paul Durrant May 14, 2019, 12:16 p.m. UTC | #1
> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: 14 May 2019 05:04
> To: xen-devel <xen-devel@lists.xenproject.org>
> Cc: Paul Durrant <Paul.Durrant@citrix.com>; Kevin Tian <kevin.tian@intel.com>
> Subject: [PATCH] VT-d: change bogus return value of intel_iommu_lookup_page()
> 
> The function passes 0 as "alloc" argument to addr_to_dma_page_maddr(),
> so -ENOMEM simply makes no sense (and its use was probably simply a
> copy-and-paste effect originating at intel_iommu_map_page()).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Paul Durrant <paul.durrant@citrix.com>

> 
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -1870,7 +1870,7 @@ static int intel_iommu_lookup_page(struc
>      if ( !pg_maddr )
>      {
>          spin_unlock(&hd->arch.mapping_lock);
> -        return -ENOMEM;
> +        return -ENOENT;
>      }
> 
>      page = map_vtd_domain_page(pg_maddr);
>
Tian, Kevin May 28, 2019, 5:29 a.m. UTC | #2
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Tuesday, May 14, 2019 8:04 PM
> 
> The function passes 0 as "alloc" argument to addr_to_dma_page_maddr(),
> so -ENOMEM simply makes no sense (and its use was probably simply a
> copy-and-paste effect originating at intel_iommu_map_page()).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 

Acked-by: Kevin Tian <kevin.tian@intel.com>
diff mbox series

Patch

--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1870,7 +1870,7 @@  static int intel_iommu_lookup_page(struc
     if ( !pg_maddr )
     {
         spin_unlock(&hd->arch.mapping_lock);
-        return -ENOMEM;
+        return -ENOENT;
     }
 
     page = map_vtd_domain_page(pg_maddr);