clk: versatile: fix memory leak
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Mon, 16 Nov 2015 13:46:40 +0000 (19:16 +0530)
committerStephen Boyd <sboyd@codeaurora.org>
Wed, 18 Nov 2015 22:25:48 +0000 (14:25 -0800)
If of_clk_parent_fill() fails then we printed an error message and
returned. But we missed freeing sp810.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/versatile/clk-sp810.c

index a1cdef6b0f9045be6dd3e47b712f02b8e485de50..6a36c8bcb5de890ad89bc5eefc9bd315d109cf39 100644 (file)
@@ -102,6 +102,7 @@ static void __init clk_sp810_of_setup(struct device_node *node)
 
        if (of_clk_parent_fill(node, parent_names, num) != num) {
                pr_warn("Failed to obtain parent clocks for SP810!\n");
+               kfree(sp810);
                return;
        }