clk: versatile: Add of_node_put() in cm_osc_setup()
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Sun, 4 Aug 2019 16:34:44 +0000 (22:04 +0530)
committerStephen Boyd <sboyd@kernel.org>
Wed, 7 Aug 2019 22:25:25 +0000 (15:25 -0700)
commit5911dba556cf41a14907ed04b5636cf852b17933
tree2296aafb06a5f24258e79a5c4348db9b906bdaca
parent5f9e832c137075045d15cd6899ab0505cfb2ca4b
clk: versatile: Add of_node_put() in cm_osc_setup()

In function cm_osc_setup, variable parent takes the value returned by
of_get_parent, which gets a node but does not put it. If parent is not
put before it goes out of scope, it may cause a memory leak.
Hence put parent before the function terminates.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lkml.kernel.org/r/20190804163445.6862-1-nishkadg.linux@gmail.com
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/versatile/clk-versatile.c