Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iommu/amd: Drop incorrect NULL check for iommu in alloc_irq_table()

alloc_irq_table() contains a conditional check for a NULL iommu pointer
when computing the NUMA node, but the function dereferences iommu
in multiple places afterwards.

All callers ensure that a valid iommu pointer is passed in, and a NULL
iommu is not expected by the current callers. Remove the incorrect
NULL check to make the assumptions consistent and address the Smatch
warning.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202512191724.meqJENXe-lkp@intel.com/
Signed-off-by: Rakuram Eswaran <rakuram.e96@gmail.com>
Reviewed-by: Ankit Soni <Ankit.Soni@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

authored by

Rakuram Eswaran and committed by
Joerg Roedel
2e666595 d2a0cac1

+1 -1
+1 -1
drivers/iommu/amd/iommu.c
··· 3249 3249 struct irq_remap_table *new_table = NULL; 3250 3250 struct amd_iommu_pci_seg *pci_seg; 3251 3251 unsigned long flags; 3252 - int nid = iommu && iommu->dev ? dev_to_node(&iommu->dev->dev) : NUMA_NO_NODE; 3252 + int nid = iommu->dev ? dev_to_node(&iommu->dev->dev) : NUMA_NO_NODE; 3253 3253 u16 alias; 3254 3254 3255 3255 spin_lock_irqsave(&iommu_table_lock, flags);