lkml.org 
[lkml]   [2016]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] iommu/amd: Remove entry from the list before freeing it
Date
From: Jan Vesely <jan.vesely@amd.com>

Signed-off-by: Jan Vesely <jan.vesely@amd.com>
---
drivers/iommu/amd_iommu.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 634f636..17c76f2 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3288,8 +3288,10 @@ static void amd_iommu_put_dm_regions(struct device *dev,
{
struct iommu_dm_region *entry, *next;

- list_for_each_entry_safe(entry, next, head, list)
+ list_for_each_entry_safe(entry, next, head, list) {
+ list_del(&entry->list);
kfree(entry);
+ }
}

static const struct iommu_ops amd_iommu_ops = {
--
2.5.5
\
 
 \ /
  Last update: 2016-05-21 20:21    [W:0.052 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site