[PATCH] clk: scmi: Free scmi_clk allocated when the clocks with invalid info are skipped

Cristian Marussi cristian.marussi at arm.com
Thu Oct 5 03:19:57 PDT 2023


On Wed, Oct 04, 2023 at 08:36:00PM +0100, Sudeep Holla wrote:
> Add the missing devm_kfree() when we skip the clocks with invalid or
> missing information from the firmware.
> 

Hi,

LGTM.

Reviewed-by: Cristian Marussi <cristian.marussi at arm.com>

Thanks,
Cristian

> Cc: Cristian Marussi <cristian.marussi at arm.com>
> Cc: Michael Turquette <mturquette at baylibre.com>
> Cc: Stephen Boyd <sboyd at kernel.org>
> Cc: linux-clk at vger.kernel.org
> Fixes: 6d6a1d82eaef ("clk: add support for clocks provided by SCMI")
> Signed-off-by: Sudeep Holla <sudeep.holla at arm.com>
> ---
>  drivers/clk/clk-scmi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> 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;
>  		}
>  
> -- 
> 2.42.0
> 



More information about the linux-arm-kernel mailing list