drivers: clk: altera: arria10: Fix wrong API used for memory free
PATCH 1/1 drivers: clk: altera: arria10: Fix wrong API used for memory free
From: Dinesh Maniyam <[email protected]>
Fix the wrong API used for memory free.
--- drivers/clk/altera/clk-arria10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/altera/clk-arria10.c +1 -1
@@ -223,7 +223,7 @@ static void socfpga_a10_handoff_workaround(struct udevice *dev) ret =clk_request (dev, &bulk->clks[0 ]);if (ret) -free (bulk->clks); +devm_kfree (dev, bulk->clks); }static int socfpga_a10_clk_bind (struct udevice *dev)
Signature · 1 line
2.43.7
Hi Dinesh,
Quoted 23 lines
From: Maniyam, Dinesh <[email protected]>
Sent: Wednesday, February 25, 2026 1:01 PM
To: [email protected] <[email protected]>
Cc: Marek Vasut <[email protected]>; Simon Goldschmidt <[email protected]>; Tom Rini <[email protected]>; Lukasz Majewski <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>
Subject: [PATCH] drivers: clk: altera: arria10: Fix wrong API used for memory free
From: Dinesh Maniyam <[email protected]>
Fix the wrong API used for memory free.Signed-off-by Dinesh Maniyam <[email protected]>---
drivers/clk/altera/clk-arria10.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/altera/clk-arria10.c +0
-0
drivers/clk/altera/clk-arria10.c static void socfpga_a10_handoff_workaround(struct udevice · line 226
Quoted 5 lines
drivers/clk/altera/clk-arria10.c +1
-1@@ -223,7 +223,7 @@ static void socfpga_a10_handoff_workaround(struct udevice *dev) ret = clk_request(dev, &bulk->clks[0]); if (ret) - free(bulk->clks); + devm_kfree(dev, bulk->clks);
you must still reset bulk->clks = NULL and bulk->count = 0 so nothing reads the old shape, treating pointer/count reset as part of “secure cleanup”
bulk->clks = NULL;
bulk->count = 0;Quoted 4 lines
drivers/clk/altera/clk-arria10.c +0
-1} static int socfpga_a10_clk_bind(struct udevice *dev) --2.43.7
Best regards,
Tien Fong
Hi TF,
Quoted 45 lines · Tien Fong
Hi Dinesh,
Quoted 23 lines
From: Maniyam, Dinesh <[email protected]>
Sent: Wednesday, February 25, 2026 1:01 PM
To: [email protected] <[email protected]>
Cc: Marek Vasut <[email protected]>; Simon Goldschmidt <[email protected]>; Tom Rini <[email protected]>; Lukasz Majewski <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>
Subject: [PATCH] drivers: clk: altera: arria10: Fix wrong API used for memory free
From: Dinesh Maniyam <[email protected]>
Fix the wrong API used for memory free.Signed-off-by Dinesh Maniyam <[email protected]>--- drivers/clk/altera/clk-arria10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/altera/clk-arria10.c +0
-0drivers/clk/altera/clk-arria10.c static void socfpga_a10_handoff_workaround(struct udevice · line 226
Quoted 5 lines
drivers/clk/altera/clk-arria10.c +1
-1@@ -223,7 +223,7 @@ static void socfpga_a10_handoff_workaround(struct udevice *dev) ret = clk_request(dev, &bulk->clks[0]); if (ret) - free(bulk->clks); + devm_kfree(dev, bulk->clks);you must still reset
bulk->clks= NULL andbulk->count= 0 so nothing reads the old shape, treating pointer/count reset as part of “secure cleanup”bulk->clks = NULL; bulk->count = 0;Quoted 4 lines
drivers/clk/altera/clk-arria10.c +0
-1} static int socfpga_a10_clk_bind(struct udevice *dev) --2.43.7
Best regards,
Tien FongAgreed. Changes will be done on v2.
Dinesh