Skip to content

Commit 032ebd8

Browse files
drinkcatjoergroedel
authored andcommitted
iommu/io-pgtable-arm-v7s: Only kmemleak_ignore L2 tables
L1 tables are allocated with __get_dma_pages, and therefore already ignored by kmemleak. Without this, the kernel would print this error message on boot, when the first L1 table is allocated: [ 2.810533] kmemleak: Trying to color unknown object at 0xffffffd652388000 as Black [ 2.818190] CPU: 5 PID: 39 Comm: kworker/5:0 Tainted: G S 4.19.16 torvalds#8 [ 2.831227] Workqueue: events deferred_probe_work_func [ 2.836353] Call trace: ... [ 2.852532] paint_ptr+0xa0/0xa8 [ 2.855750] kmemleak_ignore+0x38/0x6c [ 2.859490] __arm_v7s_alloc_table+0x168/0x1f4 [ 2.863922] arm_v7s_alloc_pgtable+0x114/0x17c [ 2.868354] alloc_io_pgtable_ops+0x3c/0x78 ... Fixes: e5fc975 ("iommu/io-pgtable: Add ARMv7 short descriptor support") Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 780da9e commit 032ebd8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iommu/io-pgtable-arm-v7s.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ static void *__arm_v7s_alloc_table(int lvl, gfp_t gfp,
216216
if (dma != phys)
217217
goto out_unmap;
218218
}
219-
kmemleak_ignore(table);
219+
if (lvl == 2)
220+
kmemleak_ignore(table);
220221
return table;
221222

222223
out_unmap:

0 commit comments

Comments
 (0)