Commit c8994b30 authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Dmitry Torokhov

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: 9c1a5077 ("input: Rewrite sparcspkr device probing.")
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220516081018.42728-1-linmq006@gmail.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent ec648fc0
...@@ -205,6 +205,7 @@ static int bbc_beep_probe(struct platform_device *op) ...@@ -205,6 +205,7 @@ static int bbc_beep_probe(struct platform_device *op)
info = &state->u.bbc; info = &state->u.bbc;
info->clock_freq = of_getintprop_default(dp, "clock-frequency", 0); info->clock_freq = of_getintprop_default(dp, "clock-frequency", 0);
of_node_put(dp);
if (!info->clock_freq) if (!info->clock_freq)
goto out_free; goto out_free;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment