Commit 94547142 authored by Anas Iqbal's avatar Anas Iqbal Committed by Rafael J. Wysocki
Browse files

thermal: devfreq_cooling: avoid unnecessary kfree of freq_table



dfc->freq_table is only allocated in the non-EM path via
devfreq_cooling_gen_tables(). In the EM path, it remains NULL.

Avoid calling kfree() unnecessarily when freq_table was never allocated.

This resolves a Smatch warning:
calling kfree() when 'dfc->freq_table' is always NULL.

Signed-off-by: default avatarAnas Iqbal <mohd.abd.6602@gmail.com>
Reviewed-by: default avatarLukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20260323094018.2264-1-mohd.abd.6602@gmail.com


Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 2dc1b0dd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -472,6 +472,7 @@ of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
remove_qos_req:
	dev_pm_qos_remove_request(&dfc->req_max_freq);
free_table:
	if (!dfc->em_pd)
		kfree(dfc->freq_table);
free_dfc:
	kfree(dfc);