File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -2387,12 +2387,18 @@ static void cleanup_domain(struct protection_domain *domain)
2387
2387
2388
2388
static void protection_domain_free (struct protection_domain * domain )
2389
2389
{
2390
+ struct domain_pgtable pgtable ;
2391
+
2390
2392
if (!domain )
2391
2393
return ;
2392
2394
2393
2395
if (domain -> id )
2394
2396
domain_id_free (domain -> id );
2395
2397
2398
+ amd_iommu_domain_get_pgtable (domain , & pgtable );
2399
+ atomic64_set (& domain -> pt_root , 0 );
2400
+ free_pagetable (& pgtable );
2401
+
2396
2402
kfree (domain );
2397
2403
}
2398
2404
@@ -2476,7 +2482,6 @@ static struct iommu_domain *amd_iommu_domain_alloc(unsigned type)
2476
2482
static void amd_iommu_domain_free (struct iommu_domain * dom )
2477
2483
{
2478
2484
struct protection_domain * domain ;
2479
- struct domain_pgtable pgtable ;
2480
2485
2481
2486
domain = to_pdomain (dom );
2482
2487
@@ -2494,10 +2499,6 @@ static void amd_iommu_domain_free(struct iommu_domain *dom)
2494
2499
dma_ops_domain_free (domain );
2495
2500
break ;
2496
2501
default :
2497
- amd_iommu_domain_get_pgtable (domain , & pgtable );
2498
- atomic64_set (& domain -> pt_root , 0 );
2499
- free_pagetable (& pgtable );
2500
-
2501
2502
if (domain -> flags & PD_IOMMUV2_MASK )
2502
2503
free_gcr3_table (domain );
2503
2504
You can’t perform that action at this time.
0 commit comments