summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorMuhammad Usama Anjum <usama.anjum@collabora.com>2022-05-10 05:34:00 +0300
committerJoerg Roedel <jroedel@suse.de>2022-05-13 16:14:56 +0300
commitcd901e9284c7893eebee6857ebe30b691ea91224 (patch)
treec202e948f9f4ed28df2b9c6ba158174f3811e4fc /drivers/iommu
parentb8397a8f4ebc0b84eefd990dc08995ba2ae9015c (diff)
downloadlinux-cd901e9284c7893eebee6857ebe30b691ea91224.tar.xz
iommu/vt-d: Remove unneeded validity check on dev
dev_iommu_priv_get() is being used at the top of this function which dereferences dev. Dev cannot be NULL after this. Remove the validity check on dev and simplify the code. Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Link: https://lore.kernel.org/r/20220313150337.593650-1-usama.anjum@collabora.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Link: https://lore.kernel.org/r/20220510023407.2759143-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/intel/iommu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index efcecfa5952a..b5caea9a7e78 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -2501,7 +2501,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
}
}
- if (dev && domain_context_mapping(domain, dev)) {
+ if (domain_context_mapping(domain, dev)) {
dev_err(dev, "Domain context map failed\n");
dmar_remove_one_dev_info(dev);
return NULL;