public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] vfio/type1: fix error return code in vfio_iommu_type1_attach_group()
@ 2017-02-09 16:01 Wei Yongjun
  2017-02-09 17:03 ` Auger Eric
  0 siblings, 1 reply; 5+ messages in thread
From: Wei Yongjun @ 2017-02-09 16:01 UTC (permalink / raw)
  To: Alex Williamson, Eric Auger, Will Deacon; +Cc: Wei Yongjun, kvm

From: Wei Yongjun <weiyongjun1@huawei.com>

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 5d704992189f ("vfio/type1: Allow transparent MSI IOVA allocation")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/vfio/vfio_iommu_type1.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index 0f353f5..bd6f293 100644
--- a/drivers/vfio/vfio_iommu_type1.c
+++ b/drivers/vfio/vfio_iommu_type1.c
@@ -1332,8 +1332,11 @@ static int vfio_iommu_type1_attach_group(void *iommu_data,
 	if (ret)
 		goto out_detach;
 
-	if (resv_msi && iommu_get_msi_cookie(domain->domain, resv_msi_base))
-		goto out_detach;
+	if (resv_msi) {
+		ret = iommu_get_msi_cookie(domain->domain, resv_msi_base);
+		if (ret)
+			goto out_detach;
+	}
 
 	list_add(&domain->next, &iommu->domain_list);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] vfio/type1: fix error return code in vfio_iommu_type1_attach_group()
  2017-02-09 16:01 [PATCH -next] vfio/type1: fix error return code in vfio_iommu_type1_attach_group() Wei Yongjun
@ 2017-02-09 17:03 ` Auger Eric
  2017-02-09 18:23   ` Alex Williamson
  0 siblings, 1 reply; 5+ messages in thread
From: Auger Eric @ 2017-02-09 17:03 UTC (permalink / raw)
  To: Wei Yongjun, Alex Williamson, Will Deacon; +Cc: Wei Yongjun, kvm

Hi Wei,

On 09/02/2017 17:01, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: 5d704992189f ("vfio/type1: Allow transparent MSI IOVA allocation")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Reviewed-by: Eric Auger <eric.auger@redhat.com>

Thanks for spotting this.

Eric


> ---
>  drivers/vfio/vfio_iommu_type1.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
> index 0f353f5..bd6f293 100644
> --- a/drivers/vfio/vfio_iommu_type1.c
> +++ b/drivers/vfio/vfio_iommu_type1.c
> @@ -1332,8 +1332,11 @@ static int vfio_iommu_type1_attach_group(void *iommu_data,
>  	if (ret)
>  		goto out_detach;
>  
> -	if (resv_msi && iommu_get_msi_cookie(domain->domain, resv_msi_base))
> -		goto out_detach;
> +	if (resv_msi) {
> +		ret = iommu_get_msi_cookie(domain->domain, resv_msi_base);
> +		if (ret)
> +			goto out_detach;
> +	}
>  
>  	list_add(&domain->next, &iommu->domain_list);
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] vfio/type1: fix error return code in vfio_iommu_type1_attach_group()
  2017-02-09 17:03 ` Auger Eric
@ 2017-02-09 18:23   ` Alex Williamson
  2017-02-10 11:56     ` Will Deacon
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Williamson @ 2017-02-09 18:23 UTC (permalink / raw)
  To: Will Deacon, Joerg Roedel; +Cc: Auger Eric, Wei Yongjun, Wei Yongjun, kvm

On Thu, 9 Feb 2017 18:03:47 +0100
Auger Eric <eric.auger@redhat.com> wrote:

> Hi Wei,
> 
> On 09/02/2017 17:01, Wei Yongjun wrote:
> > From: Wei Yongjun <weiyongjun1@huawei.com>
> > 
> > Fix to return a negative error code from the error handling
> > case instead of 0, as done elsewhere in this function.
> > 
> > Fixes: 5d704992189f ("vfio/type1: Allow transparent MSI IOVA allocation")
> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>  
> 
> Reviewed-by: Eric Auger <eric.auger@redhat.com>

Acked-by: Alex Williamson <alex.williamson@redhat.com>

Joerg/Will,

The original commit comes in through iommu/next (arm/core), please feel
free to also include this fix.  Thanks,

Alex

> > ---
> >  drivers/vfio/vfio_iommu_type1.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
> > index 0f353f5..bd6f293 100644
> > --- a/drivers/vfio/vfio_iommu_type1.c
> > +++ b/drivers/vfio/vfio_iommu_type1.c
> > @@ -1332,8 +1332,11 @@ static int vfio_iommu_type1_attach_group(void *iommu_data,
> >  	if (ret)
> >  		goto out_detach;
> >  
> > -	if (resv_msi && iommu_get_msi_cookie(domain->domain, resv_msi_base))
> > -		goto out_detach;
> > +	if (resv_msi) {
> > +		ret = iommu_get_msi_cookie(domain->domain, resv_msi_base);
> > +		if (ret)
> > +			goto out_detach;
> > +	}
> >  
> >  	list_add(&domain->next, &iommu->domain_list);
> >   

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] vfio/type1: fix error return code in vfio_iommu_type1_attach_group()
  2017-02-09 18:23   ` Alex Williamson
@ 2017-02-10 11:56     ` Will Deacon
  2017-02-10 12:51       ` Joerg Roedel
  0 siblings, 1 reply; 5+ messages in thread
From: Will Deacon @ 2017-02-10 11:56 UTC (permalink / raw)
  To: Alex Williamson; +Cc: Joerg Roedel, Auger Eric, Wei Yongjun, Wei Yongjun, kvm

On Thu, Feb 09, 2017 at 11:23:11AM -0700, Alex Williamson wrote:
> On Thu, 9 Feb 2017 18:03:47 +0100
> Auger Eric <eric.auger@redhat.com> wrote:
> > On 09/02/2017 17:01, Wei Yongjun wrote:
> > > From: Wei Yongjun <weiyongjun1@huawei.com>
> > > 
> > > Fix to return a negative error code from the error handling
> > > case instead of 0, as done elsewhere in this function.
> > > 
> > > Fixes: 5d704992189f ("vfio/type1: Allow transparent MSI IOVA allocation")
> > > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>  
> > 
> > Reviewed-by: Eric Auger <eric.auger@redhat.com>
> 
> Acked-by: Alex Williamson <alex.williamson@redhat.com>
> 
> Joerg/Will,
> 
> The original commit comes in through iommu/next (arm/core), please feel
> free to also include this fix.  Thanks,

Patch looks fine to me. Joerg, can you pick this up please?

Will

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] vfio/type1: fix error return code in vfio_iommu_type1_attach_group()
  2017-02-10 11:56     ` Will Deacon
@ 2017-02-10 12:51       ` Joerg Roedel
  0 siblings, 0 replies; 5+ messages in thread
From: Joerg Roedel @ 2017-02-10 12:51 UTC (permalink / raw)
  To: Will Deacon; +Cc: Alex Williamson, Auger Eric, Wei Yongjun, Wei Yongjun, kvm

On Fri, Feb 10, 2017 at 11:56:47AM +0000, Will Deacon wrote:
> Patch looks fine to me. Joerg, can you pick this up please?

Picked up, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-10 13:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-09 16:01 [PATCH -next] vfio/type1: fix error return code in vfio_iommu_type1_attach_group() Wei Yongjun
2017-02-09 17:03 ` Auger Eric
2017-02-09 18:23   ` Alex Williamson
2017-02-10 11:56     ` Will Deacon
2017-02-10 12:51       ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox