diff options
author | Markus Elfring | 2019-08-27 15:22:12 +0200 |
---|---|---|
committer | Geert Uytterhoeven | 2019-10-01 09:50:28 +0200 |
commit | ba28236e043dae273ce22782008e667e6e4bbd5e (patch) | |
tree | 5d743de863df08928909a3ee5c078538e65d7665 /drivers/clk/renesas | |
parent | 54ce17dd40fd846a7ac1e87e1103032933d2bd21 (diff) |
clk: renesas: mstp: Delete unnecessary kfree() in cpg_mstp_clocks_init()
A NULL pointer would be passed to a call of the function kfree()
directly after a call of the function kzalloc() failed at one place.
Remove this superfluous function call.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Link: https://lore.kernel.org/r/e66b822b-026b-29cc-e461-6334aafd1d30@web.de
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Diffstat (limited to 'drivers/clk/renesas')
-rw-r--r-- | drivers/clk/renesas/clk-mstp.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c index e326e6dc09fc..003e9ce45757 100644 --- a/drivers/clk/renesas/clk-mstp.c +++ b/drivers/clk/renesas/clk-mstp.c @@ -189,10 +189,8 @@ static void __init cpg_mstp_clocks_init(struct device_node *np) unsigned int i; group = kzalloc(struct_size(group, clks, MSTP_MAX_CLOCKS), GFP_KERNEL); - if (group == NULL) { - kfree(group); + if (!group) return; - } clks = group->clks; spin_lock_init(&group->lock); |