]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
powerpc/iommu/debug: fix ifnullfree.cocci warnings
authorkernel test robot <lkp@intel.com>
Thu, 18 Mar 2021 23:44:41 +0000 (07:44 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 29 Mar 2021 02:22:17 +0000 (13:22 +1100)
arch/powerpc/kernel/iommu.c:76:2-16: WARNING: NULL check before some freeing functions is not needed.

 NULL check before some freeing functions is not needed.

 Based on checkpatch warning
 "kfree(NULL) is safe this check is probably not required"
 and kfreeaddr.cocci by Julia Lawall.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Fixes: 691602aab9c3 ("powerpc/iommu/debug: Add debugfs entries for IOMMU tables")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210318234441.GA63469@f8e20a472e81
arch/powerpc/kernel/iommu.c

index c00214a4355c80490bf4347f0bd2f7b2da082f0f..2168714144348c2c9de38b1cee941a79f5fbc29b 100644 (file)
@@ -72,8 +72,7 @@ static void iommu_debugfs_del(struct iommu_table *tbl)
 
        sprintf(name, "%08lx", tbl->it_index);
        liobn_entry = debugfs_lookup(name, iommu_debugfs_dir);
-       if (liobn_entry)
-               debugfs_remove(liobn_entry);
+       debugfs_remove(liobn_entry);
 }
 #else
 static void iommu_debugfs_add(struct iommu_table *tbl){}