Skip to content

Commit aaa29bb

Browse files
committed
bus: ti-sysc: Fix sysc_unprepare() when no clocks have been allocated
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: 0eecc63 ("bus: ti-sysc: Add minimal TI sysc interconnect target driver") Signed-off-by: Tony Lindgren <[email protected]>
1 parent 8b30919 commit aaa29bb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/bus/ti-sysc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,9 @@ static void sysc_unprepare(struct sysc *ddata)
13311331
{
13321332
int i;
13331333

1334+
if (!ddata->clocks)
1335+
return;
1336+
13341337
for (i = 0; i < SYSC_MAX_CLOCKS; i++) {
13351338
if (!IS_ERR_OR_NULL(ddata->clocks[i]))
13361339
clk_unprepare(ddata->clocks[i]);

0 commit comments

Comments
 (0)