浏览代码

clk: versatile: fix memory leak

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>
Sudip Mukherjee 9 年之前
父节点
当前提交
47c5ee34d8
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/clk/versatile/clk-sp810.c

+ 1 - 0
drivers/clk/versatile/clk-sp810.c

@@ -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;
 	}