Skip to content

Commit b70fa3b

Browse files
committed
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 <[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]>
1 parent 8e7f37f commit b70fa3b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mm/util.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,12 @@ int __weak memcmp_pages(struct page *page1, struct page *page2)
997997
void mem_dump_obj(void *object)
998998
{
999999
if (!virt_addr_valid(object)) {
1000-
pr_cont(" non-paged (local) memory.\n");
1000+
if (object == NULL)
1001+
pr_cont(" NULL pointer.\n");
1002+
else if (object == ZERO_SIZE_PTR)
1003+
pr_cont(" zero-size pointer.\n");
1004+
else
1005+
pr_cont(" non-paged (local) memory.\n");
10011006
return;
10021007
}
10031008
if (kmem_valid_obj(object)) {

0 commit comments

Comments
 (0)