Skip to content

Commit 4712a23

Browse files
committed
powercap/dtpm: Move the 'root' reset place
The 'root' node is checked everytime a dtpm node is destroyed. When we reach the end of the hierarchy destruction function, we can unconditionnaly set the 'root' node to NULL again. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://lore.kernel.org/r/20220130210210.549877-5-daniel.lezcano@linaro.org
1 parent c404c64 commit 4712a23

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/powercap/dtpm.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ int dtpm_release_zone(struct powercap_zone *pcz)
184184
else
185185
kfree(dtpm);
186186

187-
if (root == dtpm)
188-
root = NULL;
189-
190187
return 0;
191188
}
192189

@@ -656,6 +653,8 @@ void dtpm_destroy_hierarchy(void)
656653

657654
pct = NULL;
658655

656+
root = NULL;
657+
659658
out_unlock:
660659
mutex_unlock(&dtpm_lock);
661660
}

0 commit comments

Comments
 (0)