Skip to content

Commit

Permalink
ARM i.MX: fix error-valued pointer dereference in clk_register_gate2()
Browse files Browse the repository at this point in the history
The error-valued pointer clk is used for the arg of kfree, it should be
kfree(gate) if clk_register() return ERR_PTR().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
  • Loading branch information
Wei Yongjun authored and Sascha Hauer committed Nov 16, 2012
1 parent 77b6706 commit ecf026d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/clk-gate2.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ struct clk *clk_register_gate2(struct device *dev, const char *name,

clk = clk_register(dev, &gate->hw);
if (IS_ERR(clk))
kfree(clk);
kfree(gate);

return clk;
}

0 comments on commit ecf026d

Please sign in to comment.