Re: [PATCH -next] vfio/type1: fix error return code in vfio_iommu_type1_attach_group()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

> Hi Wei,
> 
> On 09/02/2017 17:01, Wei Yongjun wrote:
> > From: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
> > 
> > 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@xxxxxxxxxx>  
> 
> Reviewed-by: Eric Auger <eric.auger@xxxxxxxxxx>

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

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);
> >   




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux