Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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>

+1
+1
drivers/clk/clk-scmi.c
··· 232 232 sclk->info = scmi_proto_clk_ops->info_get(ph, idx); 233 233 if (!sclk->info) { 234 234 dev_dbg(dev, "invalid clock info for idx %d\n", idx); 235 + devm_kfree(dev, sclk); 235 236 continue; 236 237 } 237 238