Skip to content

Commit 3f13f72

Browse files
YanfeiXujoergroedel
authored andcommitted
iommu/vt-d: Remove two WARN_ON in domain_context_mapping_one()
Remove the WARN_ON(did == 0) as the domain id 0 is reserved and set once the domain_ids is allocated. So iommu_init_domains will never return 0. Remove the WARN_ON(!table) as this pointer will be accessed in the following code, if empty "table" really happens, the kernel will report a NULL pointer reference warning at the first place. Signed-off-by: Yanfei Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lu Baolu <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent a0e9911 commit 3f13f72

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,8 +1897,6 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
18971897
struct context_entry *context;
18981898
int ret;
18991899

1900-
WARN_ON(did == 0);
1901-
19021900
if (hw_pass_through && domain_type_is_si(domain))
19031901
translation = CONTEXT_TT_PASS_THROUGH;
19041902

@@ -1944,8 +1942,6 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
19441942
if (sm_supported(iommu)) {
19451943
unsigned long pds;
19461944

1947-
WARN_ON(!table);
1948-
19491945
/* Setup the PASID DIR pointer: */
19501946
pds = context_get_sm_pds(table);
19511947
context->lo = (u64)virt_to_phys(table->table) |

0 commit comments

Comments
 (0)