Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1298903
| From | Wan ZongShun <mcuos.com@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] iommu:Check that iommu_device_create has completed successfully in alloc_iommu |
| Date | 2015-12-29 08:20 +0100 |
| Message-ID | <qKWJz-5BA-1@gated-at.bofh.it> (permalink) |
| References | <qKWJz-5BA-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
2015-12-29 13:10 GMT+08:00 Nicholas Krause <xerofoify@gmail.com>:
> This adds the proper check to alloc_iommu to make sure that the call
> to iommu_device_create has completed successfully and if not return
> to the caller the error code returned after freeing up resources
> allocated previously by alloc_iommu.
>
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
> drivers/iommu/dmar.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
> index 80e3c17..27333b6 100644
> --- a/drivers/iommu/dmar.c
> +++ b/drivers/iommu/dmar.c
> @@ -1069,9 +1069,12 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
> iommu->iommu_dev = iommu_device_create(NULL, iommu,
> intel_iommu_groups,
> "%s", iommu->name);
> + if (IS_ERR(iommu->iommu_dev)) {
> + err = PTR_ERR(iommu->iommu_dev);
> + goto err_unmap;
> + }
If so, will this bad 'iommu->iommu_dev' break your iommu work? It
seems not necessary.
>
> return 0;
> -
> err_unmap:
> unmap_iommu(iommu);
> error_free_seq_id:
> --
> 2.5.0
>
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu
--
---
Vincent Wan(Zongshun)
www.mcuos.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH] iommu:Check that iommu_device_create has completed successfully in alloc_iommu Wan ZongShun <mcuos.com@gmail.com> - 2015-12-29 08:20 +0100
csiph-web