OSDN Git Service

arm64: vdso: Mark vdso_pagelist allocation as not a leak
authorSultan Alsawaf <sultan@kerneltoast.com>
Sun, 30 Jun 2019 04:56:06 +0000 (21:56 -0700)
committer0ranko0P <ranko0p@outlook.com>
Sat, 7 Dec 2019 10:22:17 +0000 (18:22 +0800)
The vdso_pagelist allocation is stored inside the vDSO mappings, which
are static, so the memory is never leaked. However, kmemleak thinks that
vdso_pagelist is leaked because the vDSO mappings are read-only after
init.

Fix kmemleak's false positive by marking the allocation as not a leak.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
arch/arm64/kernel/vdso.c

index 91f541a..39836b2 100644 (file)
@@ -191,6 +191,8 @@ static int __init vdso_mappings_init(const char *name,
        if (vdso_pagelist == NULL)
                return -ENOMEM;
 
+       kmemleak_not_leak(vdso_pagelist);
+
        /* Grab the vDSO data page. */
        vdso_pagelist[0] = phys_to_page(__pa_symbol(vdso_data));