mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
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>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
fe07bfda2f
commit
f3c1410579
@@ -207,6 +207,9 @@ int dtpm_release_zone(struct powercap_zone *pcz)
|
|||||||
if (dtpm->ops)
|
if (dtpm->ops)
|
||||||
dtpm->ops->release(dtpm);
|
dtpm->ops->release(dtpm);
|
||||||
|
|
||||||
|
if (root == dtpm)
|
||||||
|
root = NULL;
|
||||||
|
|
||||||
kfree(dtpm);
|
kfree(dtpm);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user