diff mbox series

[05/10] clk: ti: One function call less in ti_fapll_synth_setup() after error detection

Message ID f0f00368-9985-4517-8019-010f744a0e39@web.de (mailing list archive)
State Changes Requested, archived
Headers show
Series clk: ti: Adjustments for eight function implementations | expand

Commit Message

Markus Elfring Dec. 24, 2023, 4:44 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 24 Dec 2023 14:05:41 +0100

The kfree() function was called in one case by
the ti_fapll_synth_setup() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.

Thus use another label.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/clk/ti/fapll.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--
2.43.0
diff mbox series

Patch

diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c
index e9956e3ccd65..d4674ec3d7e9 100644
--- a/drivers/clk/ti/fapll.c
+++ b/drivers/clk/ti/fapll.c
@@ -504,7 +504,7 @@  static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd,

 	synth = kzalloc(sizeof(*synth), GFP_KERNEL);
 	if (!synth)
-		goto free;
+		goto free_init;

 	synth->fd = fd;
 	synth->index = index;
@@ -524,6 +524,7 @@  static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd,

 free:
 	kfree(synth);
+free_init:
 	kfree(init);

 	return clk;