clk: davinci: pll: Add of_node_put() in of_davinci_pll_init()
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Sun, 4 Aug 2019 16:28:24 +0000 (21:58 +0530)
committerStephen Boyd <sboyd@kernel.org>
Wed, 7 Aug 2019 22:25:45 +0000 (15:25 -0700)
commitd55841ce1115ce08614bde66a780211f4ea12ae1
tree3fd5c8f9652512c568e60fcbf2a7c2b03011be41
parent5911dba556cf41a14907ed04b5636cf852b17933
clk: davinci: pll: Add of_node_put() in of_davinci_pll_init()

The variable child in the function of_davinci_pll_init takes the value
of of_get_child_by_name, which gets a node but does not put it. If child
is not put before the function returns it may cause a memory leak. Hence
put child before two return statements.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lkml.kernel.org/r/20190804162824.6338-1-nishkadg.linux@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/davinci/pll.c