lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5t3aovkbk4oziiddabpvlmdksllwi55uqycnktweu56fj7ts7f@eszra6duc6ya>
Date: Tue, 6 Jan 2026 10:21:35 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Haotian Zhang <vulab@...as.ac.cn>
Cc: andreas@...nade.info, khilman@...nel.org, rafael@...nel.org, 
	linux-omap@...r.kernel.org, linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] cpufreq: OMAP: Fix resource leak in probe error path
 and remove

On 05-01-26, 21:12, Haotian Zhang wrote:
> The current omap_cpufreq_probe() uses regulator_get() to obtain the MPU
> regulator but does not release it in omap_cpufreq_remove() or when
> cpufreq_register_driver() fails.
> 
> Add the missing regulator_put() in the remove function and in the
> error handling path of the probe function to prevent resource leaks.
> Also ensure the mpu_reg pointer is set to NULL after release to avoid
> dangling pointers.
> 
> Fixes: 53dfe8a884e6 ("cpufreq: OMAP: scale voltage along with frequency")
> Suggested-by: Andreas Kemnade <andreas@...nade.info>
> Signed-off-by: Haotian Zhang <vulab@...as.ac.cn>
> 
> ---
> Changes in v2:
>  - Revert to using regulator_get() instead of devm_regulator_get()
>    to ensure immediate release of unusable regulators and
>    safer handling of the global mpu_reg variable.
>  - Add explicit regulator_put() in omap_cpufreq_remove().
>  - Add error handling for cpufreq_register_driver() in probe.
> ---
>  drivers/cpufreq/omap-cpufreq.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)

I have left some feedback on the previous version. Lets continue the discussion
there.

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ