From: Wei Yongjun Date: Thu, 25 Oct 2012 15:02:18 +0000 (+0800) Subject: ARM i.MX: fix error-valued pointer dereference in clk_register_gate2() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ecf026dc340f9700ed3c485344913a8a2b10e2e3;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git ARM i.MX: fix error-valued pointer dereference in clk_register_gate2() 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 Signed-off-by: Sascha Hauer --- diff --git a/arch/arm/mach-imx/clk-gate2.c b/arch/arm/mach-imx/clk-gate2.c index 3c1b8ff9a0a6..cc49c7ae186e 100644 --- a/arch/arm/mach-imx/clk-gate2.c +++ b/arch/arm/mach-imx/clk-gate2.c @@ -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; }