]> git.baikalelectronics.ru Git - kernel.git/commit
PM / devfreq: exynos-ppmu: Fix refcount leak in of_get_devfreq_events
authorMiaoqian Lin <linmq006@gmail.com>
Thu, 26 May 2022 08:28:56 +0000 (12:28 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Jul 2022 15:36:49 +0000 (17:36 +0200)
commit72644e64ec7924b5f2553d1d819a47962a82303e
treedce3966a947233a0cfd3ca9acb6225da376168bd
parent72c7d3f66fcdb4ff2eebf8f33494a4daa920ebf5
PM / devfreq: exynos-ppmu: Fix refcount leak in of_get_devfreq_events

commit a3b1a00c981738ff3e2830dd54dacd321beee044 upstream.

of_get_child_by_name() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
This function only calls of_node_put() in normal path,
missing it in error paths.
Add missing of_node_put() to avoid refcount leak.

Fixes: e35bee0f9278 ("PM / devfreq: event: Add devfreq_event class")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/devfreq/event/exynos-ppmu.c