Re: [PATCH] kmemleak: Add option to print warnings to dmesg
From: Catalin Marinas <catalin.marinas@arm.com>
Date: 2018-08-24 12:57:47
Also in:
lkml
From: Catalin Marinas <catalin.marinas@arm.com>
Date: 2018-08-24 12:57:47
Also in:
lkml
On Fri, Aug 24, 2018 at 02:40:11PM +0200, Vincent Whitchurch wrote:
diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 9a085d525bbc..61ba47a357fc 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c@@ -311,6 +311,9 @@ static void hex_dump_object(struct seq_file *seq, const u8 *ptr = (const u8 *)object->pointer; size_t len; + if (!seq) + return; + /* limit the number of lines to HEX_MAX_LINES */ len = min_t(size_t, object->size, HEX_MAX_LINES * HEX_ROW_SIZE);
We have a print_hex_dump() function you could use here instead of skipping it. Sometimes such information is useful to capture part of the object state. -- Catalin