OSDN Git Service

bus: ti-sysc: Fix sysc_unprepare() when no clocks have been allocated
authorTony Lindgren <tony@atomide.com>
Thu, 21 Mar 2019 18:00:21 +0000 (11:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:36 +0000 (14:50 +0100)
commit2fe6d9c113f52b8eda42dd65eeeac6ee424c765e
tree5a1b7e5ee14c4d7eed39ea748e1a06a9f2de3abd
parent0d244fd367ce2616c641e8700131174cb802ae25
bus: ti-sysc: Fix sysc_unprepare() when no clocks have been allocated

[ Upstream commit aaa29bb01cc4bf5a87dbdb219efba3b09f259d8e ]

If we return early before ddata->clocks have been allocated we will get a
NULL pointer dereference in sysc_unprepare(). Let's fix this by returning
early when no clocks are allocated.

Fixes: 0eecc636e5a2 ("bus: ti-sysc: Add minimal TI sysc interconnect target driver")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bus/ti-sysc.c