summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCai Li <cai.li@spreadtrum.com>2017-11-21 17:24:38 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-25 11:05:48 +0100
commit82acb5fc22ece01395dc01e51159c4544bb75297 (patch)
tree1e0e082097cd830f65d7e2e5c283f060bee392e6 /include
parent3250df9fa82bb8c25af7acfd5875d684b9995119 (diff)
clk: fix a panic error caused by accessing NULL pointer
[ Upstream commit 975b820b6836b6b6c42fb84cd2e772e2b41bca67 ] 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: dfc202ead312 (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@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/trace/events/clk.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/trace/events/clk.h b/include/trace/events/clk.h
index 758607226bfd..2cd449328aee 100644
--- a/include/trace/events/clk.h
+++ b/include/trace/events/clk.h
@@ -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))