clk: qcom: Do not drop device node twice
authorGuenter Roeck <linux@roeck-us.net>
Sat, 11 Feb 2017 23:04:56 +0000 (15:04 -0800)
committerStephen Boyd <sboyd@codeaurora.org>
Thu, 16 Feb 2017 01:17:55 +0000 (17:17 -0800)
of_find_node_by_name() drops the reference to a passed device node.
It is not necessary to drop it again, and doing so may result in the
device node being released prematurely.

Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Fixes: ee15faffef11 ("clk: qcom: common: Add API to register board clocks backwards compatibly")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/qcom/common.c

index cfab7b400381ad467f39d9628930745f6345cce4..03f9d316f969126c201a42227180103b7d97903d 100644 (file)
@@ -145,7 +145,6 @@ static int _qcom_cc_register_board_clk(struct device *dev, const char *path,
        clocks_node = of_find_node_by_path("/clocks");
        if (clocks_node)
                node = of_find_node_by_name(clocks_node, path);
-       of_node_put(clocks_node);
 
        if (!node) {
                fixed = devm_kzalloc(dev, sizeof(*fixed), GFP_KERNEL);