vfio/type1: fix error return code in vfio_iommu_type1_attach_group()
Subsystems (2)
PATCH 1/1 vfio/type1: fix error return code in vfio_iommu_type1_attach_group()
From: Wei Yongjun <[email protected]>
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
--- drivers/vfio/vfio_iommu_type1.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/vfio/vfio_iommu_type1.c +5 -2
@@ -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);
Hi Wei,
Quoted 7 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
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 <[email protected]>
Thanks for spotting this.
Eric
Quoted 22 lines
--- drivers/vfio/vfio_iommu_type1.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/vfio/vfio_iommu_type1.c +5
-2@@ -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);
Alex Williamson
Acked-byQuoted 5 lines · On Thu, 9 Feb 2017 18:03:47 +0100 Auger Eric <[email protected]> wrote:
Hi Wei,
Quoted 2 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
Quoted 7 lines
Quoted 5 lines
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 <[email protected]>Reviewed-by Eric Auger <[email protected]>
Joerg/Will,
The original commit comes in through iommu/next (arm/core), please feel free to also include this fix. Thanks,
Alex
Quoted 22 lines
Quoted 22 lines
--- drivers/vfio/vfio_iommu_type1.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/vfio/vfio_iommu_type1.c +5
-2@@ -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);
Quoted 11 lines · Alex Williamson
Quoted 9 lines · On Thu, 9 Feb 2017 18:03:47 +0100 Auger Eric <[email protected]> wrote:
Quoted 7 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
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 <[email protected]>
Quoted 8 lines
Quoted 1 line
Reviewed-by Eric Auger <[email protected]>Acked-by Alex Williamson <[email protected]>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
Joerg Roedel
AppliedQuoted 1 line · Will Deacon
Patch looks fine to me. Joerg, can you pick this up please?
Picked up, thanks.