On 12/9/20 2:13 AM, [email protected] wrote: > From: "Paul E. McKenney" <[email protected]> > > 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]> > Signed-off-by: Paul E. McKenney <[email protected]>
Acked-by: Vlastimil Babka <[email protected]> > --- > mm/util.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/mm/util.c b/mm/util.c > index d0e60d2..8c2449f 100644 > --- a/mm/util.c > +++ b/mm/util.c > @@ -985,7 +985,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)) { >

