Skip to content

Commit

Permalink
drivers/clk/keystone: avoid a memory leak
Browse files Browse the repository at this point in the history
In ti_syscon_gate_clk_register, priv is allocated by devm_kzalloc.
On the error path, it should be freed before return.

Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
  • Loading branch information
AnnYugawa authored and intel-lab-lkp committed Jul 22, 2022
1 parent b293bc9 commit c8db4a1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/clk/keystone/syscon-clk.c
Expand Up @@ -84,6 +84,7 @@ static struct clk_hw

ret = devm_clk_hw_register(dev, &priv->hw);
if (ret)
devm_kfree(dev, priv);
return ERR_PTR(ret);

return &priv->hw;
Expand Down

0 comments on commit c8db4a1

Please sign in to comment.