From: Alex Williamson Subject: Re: [PATCH -next] vfio/type1: fix error return code in vfio_iommu_type1_attach_group() Date: Thu, 9 Feb 2017 11:23:11 -0700 Message-ID: <20170209112311.4d4616a9@t450s.home> References: <20170209160158.24497-1-weiyj.lk@gmail.com> <98b720c2-3f2a-0418-abb0-77b45b50a9ff@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Auger Eric , Wei Yongjun , Wei Yongjun , kvm@vger.kernel.org To: Will Deacon , Joerg Roedel Return-path: Received: from mx1.redhat.com ([209.132.183.28]:41048 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753262AbdBISrw (ORCPT ); Thu, 9 Feb 2017 13:47:52 -0500 In-Reply-To: <98b720c2-3f2a-0418-abb0-77b45b50a9ff@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 9 Feb 2017 18:03:47 +0100 Auger Eric wrote: > Hi Wei, > > On 09/02/2017 17:01, Wei Yongjun wrote: > > From: Wei Yongjun > > > > 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 > > Reviewed-by: Eric Auger Acked-by: Alex Williamson 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); > >