aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudeep Holla <[email protected]>2023-10-04 20:36:00 +0100
committerSudeep Holla <[email protected]>2023-10-08 21:16:30 +0100
commit3537a75e73f3420614a358d0c8b390ea483cc87d (patch)
treecb668a4427feb43e612fd3fd93d6cf433dbd44e0
parent908af696c513bdd028fb16499f12febc0dc48acd (diff)
clk: scmi: Free scmi_clk allocated when the clocks with invalid info are skipped
Add the missing devm_kfree() when we skip the clocks with invalid or missing information from the firmware. Cc: Cristian Marussi <[email protected]> Cc: Michael Turquette <[email protected]> Cc: Stephen Boyd <[email protected]> Cc: [email protected] Fixes: 6d6a1d82eaef ("clk: add support for clocks provided by SCMI") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sudeep Holla <[email protected]>
-rw-r--r--drivers/clk/clk-scmi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
index 2e1337b511eb..3f525bed9794 100644
--- a/drivers/clk/clk-scmi.c
+++ b/drivers/clk/clk-scmi.c
@@ -232,6 +232,7 @@ static int scmi_clocks_probe(struct scmi_device *sdev)
sclk->info = scmi_proto_clk_ops->info_get(ph, idx);
if (!sclk->info) {
dev_dbg(dev, "invalid clock info for idx %d\n", idx);
+ devm_kfree(dev, sclk);
continue;
}