From: Denis Kirjanov <kda@linux-powerpc.org>
To: linuxppc-dev@lists.ozlabs.org
Cc: Michael Ellerman <mpe@ellerman.id.au>,
Catalin Marinas <catalin.marinas@arm.com>,
Denis Kirjanov <kda@linux-powerpc.org>
Subject: [PATCH] powerpc: msi: mark bitmap with kmemleak_not_leak()
Date: Sun, 13 Sep 2015 21:36:37 +0300 [thread overview]
Message-ID: <1442169397-4271-1-git-send-email-kda@linux-powerpc.org> (raw)
During the MSI bitmap test on boot kmemleak spews the following trace:
unreferenced object 0xc00000016e86c900 (size 64):
comm "swapper/0", pid 1, jiffies 4294893173 (age 518.024s)
hex dump (first 32 bytes):
00 00 01 ff 7f ff 7f 37 00 00 00 00 00 00 00 00
.......7........
ff ff ff ff ff ff ff ff 01 ff ff ff ff ff ff ff
................
backtrace:
[<c00000000003eebc>] .zalloc_maybe_bootmem+0x3c/0x380
[<c000000000042d6c>] .msi_bitmap_alloc+0x3c/0xb0
[<c000000000a9aff8>]
.msi_bitmap_selftest+0x30/0x2b4
[<c0000000000090f4>]
.do_one_initcall+0xd4/0x270
[<c000000000a8e250>]
.kernel_init_freeable+0x1a0/0x280
[<c000000000009b5c>]
.kernel_init+0x1c/0x120
[<c000000000007fbc>]
.ret_from_kernel_thread+0x58/0x9c
The comment in msi_bitmap_free() states that we can't free
the bitmap so mark it with the kmemleak_not_leak().
Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
---
arch/powerpc/sysdev/msi_bitmap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/sysdev/msi_bitmap.c b/arch/powerpc/sysdev/msi_bitmap.c
index 73b64c7..bd9fa54 100644
--- a/arch/powerpc/sysdev/msi_bitmap.c
+++ b/arch/powerpc/sysdev/msi_bitmap.c
@@ -139,6 +139,7 @@ int msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
void msi_bitmap_free(struct msi_bitmap *bmp)
{
/* we can't free the bitmap we don't know if it's bootmem etc. */
+ kmemleak_not_leak(bmp->bitmap);
of_node_put(bmp->of_node);
bmp->bitmap = NULL;
}
--
2.4.0
next reply other threads:[~2015-09-13 19:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-13 18:36 Denis Kirjanov [this message]
2015-09-14 6:04 ` [PATCH] powerpc: msi: mark bitmap with kmemleak_not_leak() Michael Ellerman
2015-09-14 9:15 ` Catalin Marinas
2015-09-14 9:36 ` Michael Ellerman
2015-09-14 10:00 ` Catalin Marinas
2015-09-14 10:42 ` Denis Kirjanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442169397-4271-1-git-send-email-kda@linux-powerpc.org \
--to=kda@linux-powerpc.org \
--cc=catalin.marinas@arm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).