Skip to content
Commit 98034917 authored by Zumeng Chen's avatar Zumeng Chen Committed by Meng Li
Browse files

dpaa_ethernet: fix kmemleak false-positive reports for skb



Kmemleak reports following false positive memory leaks for each sk
buffers allocated by DPAA (build_skb()) in _dpa_bp_add_8_bufs:

unreferenced object 0xffff00000310d100 (size 224):
  comm "swapper/0", pid 1, jiffies 4294892973 (age 64.948s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000003c47dcde>] kmem_cache_alloc+0x1e0/0x4e4
    [<0000000008f09091>] __build_skb+0x38/0xd4
    [<000000001358eefb>] build_skb+0x28/0x9c
    [<000000005213aa43>] dpaa_eth_refill_bpools+0xe0/0x35c
    [<00000000d936eefb>] dpaa_eth_priv_probe+0x758/0x794
    [<00000000f1140028>] platform_drv_probe+0x60/0xb4
    [<000000002962c77a>] really_probe+0xdc/0x4a0
    [<0000000044f4dd2b>] driver_probe_device+0x64/0xcc
    [<00000000ae32fd5d>] device_driver_attach+0xcc/0xd4
    [<00000000163633a3>] __driver_attach+0x90/0x130
    [<0000000031f611a6>] bus_for_each_dev+0x7c/0xd0
    [<000000007095e9c3>] driver_attach+0x30/0x3c
    [<0000000035c9989f>] bus_add_driver+0x114/0x200
    [<00000000b14c744e>] driver_register+0x84/0x140
    [<00000000d133e73f>] __platform_driver_register+0x54/0x60
    [<000000006e2c296f>] dpa_load+0x6c/0xb0

This happens because DPAA allocates SK buffers and then passes pointers
for DMA usages, which belongs to DEV MMIO space.  Kmemleak does not scan
IO memory and so reports memory leaks.

Hence, mark allocated sk buffers as false positive explicitly.

Signed-off-by: default avatarZumeng Chen <zumeng.chen@windriver.com>
Signed-off-by: default avatarXulin Sun <xulin.sun@windriver.com>
Signed-off-by: default avatarMeng Li <Meng.Li@windriver.com>
parent eff9c634
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment