Skip to content

Commit

Permalink
iommu/vt-d: Remove misleading "domain 0" test from domain_exit()
Browse files Browse the repository at this point in the history
The "Domain 0 is reserved, so dont process it" comment suggests that a NULL
pointer corresponds to domain 0.  I don't think that's true, and in any
case, every caller supplies a non-NULL domain pointer that has already been
dereferenced, so the test is unnecessary.

Remove the test for a null "domain" pointer.  No functional change
intended.

This null pointer check was added by 5e98c4b ("Allocation and free
functions of virtual machine domain").

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Bjorn Helgaas authored and Joerg Roedel committed Feb 11, 2019
1 parent 7175323 commit f096d66
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/iommu/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1903,10 +1903,6 @@ static void domain_exit(struct dmar_domain *domain)
{
struct page *freelist;

/* Domain 0 is reserved, so dont process it */
if (!domain)
return;

/* Remove associated devices and clear attached or cached domains */
rcu_read_lock();
domain_remove_dev_info(domain);
Expand Down

0 comments on commit f096d66

Please sign in to comment.