summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWen Congyang <wency@cn.fujitsu.com>2012-09-20 14:04:47 +0800
committerBen Hutchings <ben@decadent.org.uk>2012-10-10 03:31:00 +0100
commitb72a2bd8e49609b2b6f9d170326f70dbbd8f8b8a (patch)
tree4fb6a9c2edef54f6db737ee4d31b135454ed2643 /include
parentb0162ce56654616f0c5cdb48b06e448c2ee400cc (diff)
tracing: Don't call page_to_pfn() if page is NULL
commit 85f2a2ef1d0ab99523e0b947a2b723f5650ed6aa upstream. When allocating memory fails, page is NULL. page_to_pfn() will cause the kernel panicked if we don't use sparsemem vmemmap. Link: http://lkml.kernel.org/r/505AB1FF.8020104@cn.fujitsu.com Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Acked-by: Mel Gorman <mel@csn.ul.ie> Reviewed-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/trace/events/kmem.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h
index a9c87ad8331c..a9536da4f30e 100644
--- a/include/trace/events/kmem.h
+++ b/include/trace/events/kmem.h
@@ -214,7 +214,7 @@ TRACE_EVENT(mm_page_alloc,
TP_printk("page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s",
__entry->page,
- page_to_pfn(__entry->page),
+ __entry->page ? page_to_pfn(__entry->page) : 0,
__entry->order,
__entry->migratetype,
show_gfp_flags(__entry->gfp_flags))
@@ -240,7 +240,7 @@ DECLARE_EVENT_CLASS(mm_page,
TP_printk("page=%p pfn=%lu order=%u migratetype=%d percpu_refill=%d",
__entry->page,
- page_to_pfn(__entry->page),
+ __entry->page ? page_to_pfn(__entry->page) : 0,
__entry->order,
__entry->migratetype,
__entry->order == 0)