mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
tracing: Don't call page_to_pfn() if page is NULL
commit 85f2a2ef1d
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
Acked-by: Mel Gorman <mel@csn.ul.ie>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
dca2dd18c6
commit
c648535596
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue