Skip to content

Commit f3c1410

Browse files
dlezcanorafaeljw
authored andcommitted
powercap/drivers/dtpm: Fix root node initialization
The root node is not set to NULL when the dtpm root node is removed. Consequently, it is not possible to create a new root as it is already set. Set the root node to NULL when the last node is removed. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent fe07bfd commit f3c1410

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/powercap/dtpm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ int dtpm_release_zone(struct powercap_zone *pcz)
207207
if (dtpm->ops)
208208
dtpm->ops->release(dtpm);
209209

210+
if (root == dtpm)
211+
root = NULL;
212+
210213
kfree(dtpm);
211214

212215
return 0;

0 commit comments

Comments
 (0)