Skip to content

Commit c8994b3

Browse files
Yuuoniydtor
authored andcommitted
Input: sparcspkr - fix refcount leak in bbc_beep_probe
of_find_node_by_path() calls of_find_node_opts_by_path(), which returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 9c1a507 ("input: Rewrite sparcspkr device probing.") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220516081018.42728-1-linmq006@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent ec648fc commit c8994b3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/input/misc/sparcspkr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ static int bbc_beep_probe(struct platform_device *op)
205205

206206
info = &state->u.bbc;
207207
info->clock_freq = of_getintprop_default(dp, "clock-frequency", 0);
208+
of_node_put(dp);
208209
if (!info->clock_freq)
209210
goto out_free;
210211

0 commit comments

Comments
 (0)