]> git.itanic.dy.fi Git - linux-stable/commitdiff
clk: scmi: Free scmi_clk allocated when the clocks with invalid info are skipped
authorSudeep Holla <sudeep.holla@arm.com>
Wed, 4 Oct 2023 19:36:00 +0000 (20:36 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Sun, 8 Oct 2023 20:16:30 +0000 (21:16 +0100)
Add the missing devm_kfree() when we skip the clocks with invalid or
missing information from the firmware.

Cc: Cristian Marussi <cristian.marussi@arm.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Fixes: 6d6a1d82eaef ("clk: add support for clocks provided by SCMI")
Link: https://lore.kernel.org/r/20231004193600.66232-1-sudeep.holla@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/clk/clk-scmi.c

index 2e1337b511ebf6b98f88eec064d3307989de1754..3f525bed9794f963df017d322d5797c20a9b945c 100644 (file)
@@ -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;
                }