lkml.org 
[lkml]   [2021]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Intel IOMMU: fix sysfs leak in hotplug init path
From
Date
Hi Rolf,

On 4/21/21 11:12 PM, Rolf Eike Beer wrote:
> Signed-off-by: Rolf Eike Beer <eb@emlix.com>

Thanks for the patch!

Can you please adjust the subject to "iommu/vt-d: Fix sysfs leak in
alloc_domain()"? It's not only for hotplug path.

Please also add commit message.

Add below Fixes tag as well:

Fixes: 39ab9555c2411 ("iommu: Add sysfs bindings for struct iommu_device")

> ---
> drivers/iommu/intel/dmar.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> I have not actually tested this but I guess it should match the code in
> free_iommu() just below.
>
> diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
> index d5c51b5c20af..fb37a9b79b3a 100644
> --- a/drivers/iommu/intel/dmar.c
> +++ b/drivers/iommu/intel/dmar.c
> @@ -1144,7 +1144,7 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
>
> err = iommu_device_register(&iommu->iommu);
> if (err)
> - goto err_unmap;
> + goto err_unregister;
> }
>
> drhd->iommu = iommu;
> @@ -1152,6 +1152,8 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
>
> return 0;
>
> +err_unregister:
> + iommu_device_sysfs_remove(&iommu->iommu);
> err_unmap:
> unmap_iommu(iommu);
> error_free_seq_id:
>

Best regards,
baolu

\
 
 \ /
  Last update: 2021-04-22 04:57    [W:0.058 / U:0.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site