mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-11-27 17:41:49 +00:00
mm: Make mem_dump_obj() handle NULL and zero-sized pointers
This commit makes mem_dump_obj() call out NULL and zero-sized pointers specially instead of classifying them as non-paged memory. Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: <linux-mm@kvack.org> Reported-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Vlastimil Babka <vbabka@suse.cz> Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
parent
8e7f37f2aa
commit
b70fa3b12f
@ -997,6 +997,11 @@ int __weak memcmp_pages(struct page *page1, struct page *page2)
|
||||
void mem_dump_obj(void *object)
|
||||
{
|
||||
if (!virt_addr_valid(object)) {
|
||||
if (object == NULL)
|
||||
pr_cont(" NULL pointer.\n");
|
||||
else if (object == ZERO_SIZE_PTR)
|
||||
pr_cont(" zero-size pointer.\n");
|
||||
else
|
||||
pr_cont(" non-paged (local) memory.\n");
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user