OSDN Git Service

clk: fix a panic error caused by accessing NULL pointer
authorCai Li <cai.li@spreadtrum.com>
Tue, 21 Nov 2017 09:24:38 +0000 (17:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:08:02 +0000 (11:08 +0100)
commit30fe9f094c1784f03d08a977e17f66ef88095ca3
tree5e515195ed382ace09c4d5e154f5c02505e12019
parent03e82f2b21579e8ff032a8aee018e2f5022eb4b4
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@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/trace/events/clk.h