Message ID | 20170209160158.24497-1-weiyj.lk@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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); >
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); > >
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
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.
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);