mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 06:25:52 +02:00
bus: ti-sysc: Fix sysc_unprepare() when no clocks have been allocated
[ Upstream commitaaa29bb01c] 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:0eecc636e5("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>
This commit is contained in:
parent
0d244fd367
commit
2fe6d9c113
|
|
@ -1400,6 +1400,9 @@ static void sysc_unprepare(struct sysc *ddata)
|
|||
{
|
||||
int i;
|
||||
|
||||
if (!ddata->clocks)
|
||||
return;
|
||||
|
||||
for (i = 0; i < SYSC_MAX_CLOCKS; i++) {
|
||||
if (!IS_ERR_OR_NULL(ddata->clocks[i]))
|
||||
clk_unprepare(ddata->clocks[i]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user