diff options
author | Liu Ying <Ying.Liu@freescale.com> | 2015-11-26 16:30:08 +0800 |
---|---|---|
committer | Octavian Purdila <octavian.purdila@nxp.com> | 2017-02-23 14:21:42 +0200 |
commit | 00f824bf4c0a27dbaddfb6c05b999948c6d1177f (patch) | |
tree | d5d564f151681406516f1ba2a4647972cf8d42ee /drivers/mxc | |
parent | 3372906386a56ccec9f3fd0b10b77f1e8e4f3c6e (diff) |
MLK-11911-4 mxc IPUv3: pixel clk: Free di_div clk memory if clk_regiser fails
This patch fixes the following issue reported by Coverity:
if (IS_ERR(clk))
freed_arg: kfree frees clk. [Note: The source code implementation of the
function has been overridden by a builtin model.]
kfree(clk);
Use after free (USE_AFTER_FREE)
use_after_free: Using freed pointer clk.
return clk;
Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Diffstat (limited to 'drivers/mxc')
-rw-r--r-- | drivers/mxc/ipu3/ipu_pixel_clk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mxc/ipu3/ipu_pixel_clk.c b/drivers/mxc/ipu3/ipu_pixel_clk.c index 4efb6b7d909a..7d3e96c07d4a 100644 --- a/drivers/mxc/ipu3/ipu_pixel_clk.c +++ b/drivers/mxc/ipu3/ipu_pixel_clk.c @@ -238,7 +238,7 @@ struct clk *clk_register_div_pix_clk(struct device *dev, const char *name, clk = clk_register(dev, &di_div->hw); if (IS_ERR(clk)) - kfree(clk); + kfree(di_div); return clk; } |