1
0
Fork 0

clk: fix a panic error caused by accessing NULL pointer

[ Upstream commit 975b820b68 ]

In some cases the clock parent would be set NULL when doing re-parent,
it will cause a NULL pointer accessing if clk_set trace event is
enabled.

This patch sets the parent as "none" if the input parameter is NULL.

Fixes: dfc202ead3 (clk: Add tracepoints for hardware operations)
Signed-off-by: Cai Li <cai.li@spreadtrum.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@spreadtrum.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pull/10/head
Cai Li 2017-11-21 17:24:38 +08:00 committed by Greg Kroah-Hartman
parent 03e82f2b21
commit 30fe9f094c
1 changed files with 2 additions and 2 deletions

View File

@ -134,12 +134,12 @@ DECLARE_EVENT_CLASS(clk_parent,
TP_STRUCT__entry(
__string( name, core->name )
__string( pname, parent->name )
__string( pname, parent ? parent->name : "none" )
),
TP_fast_assign(
__assign_str(name, core->name);
__assign_str(pname, parent->name);
__assign_str(pname, parent ? parent->name : "none");
),
TP_printk("%s %s", __get_str(name), __get_str(pname))