Re: [PATCH v2] iommu: fix an incorrect NULL check on list iterator

2022-05-04 Thread Joerg Roedel
On Sun, May 01, 2022 at 09:28:23PM +0800, Xiaomeng Tong wrote: > The bug is here: > if (!iommu || iommu->dev->of_node != spec->np) { > > The list iterator value 'iommu' will *always* be set and non-NULL by > list_for_each_entry(), so it is incorrect to assume that the iterator > value will

Re: [PATCH v2] iommu: fix an incorrect NULL check on list iterator

2022-05-02 Thread kernel test robot
Hi Xiaomeng, Thank you for the patch! Yet something to improve: [auto build test ERROR on joro-iommu/next] [also build test ERROR on v5.18-rc5 next-20220429] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as

[PATCH v2] iommu: fix an incorrect NULL check on list iterator

2022-05-01 Thread Xiaomeng Tong
The bug is here: if (!iommu || iommu->dev->of_node != spec->np) { The list iterator value 'iommu' will *always* be set and non-NULL by list_for_each_entry(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element is found (in fact, it will

[PATCH v2] iommu: fix an incorrect NULL check on list iterator

2022-05-01 Thread Xiaomeng Tong
The bug is here: if (!iommu || iommu->dev->of_node != spec->np) { The list iterator value 'iommu' will *always* be set and non-NULL by list_for_each_entry(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element is found (in fact, it will