Skip to content

Commit

Permalink
mm: Make mem_dump_obj() handle NULL and zero-sized pointers
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: <[email protected]>
Reported-by: Andrii Nakryiko <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Tested-by: Naresh Kamboju <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
  • Loading branch information
paulmckrcu committed Jan 22, 2021
1 parent 8e7f37f commit b70fa3b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mm/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,12 @@ int __weak memcmp_pages(struct page *page1, struct page *page2)
void mem_dump_obj(void *object)
{
if (!virt_addr_valid(object)) {
pr_cont(" non-paged (local) memory.\n");
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;
}
if (kmem_valid_obj(object)) {
Expand Down

0 comments on commit b70fa3b

Please sign in to comment.