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]
Date:   Mon, 9 Jan 2017 14:39:37 -0800
From:   Stephen Boyd <sboyd@...eaurora.org>
To:     Viresh Kumar <viresh.kumar@...aro.org>
Cc:     Rafael Wysocki <rjw@...ysocki.net>,
        Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>,
        Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
        linaro-kernel@...ts.linaro.org, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Vincent Guittot <vincent.guittot@...aro.org>
Subject: Re: [PATCH 12/12] PM / OPP: Update Documentation to remove RCU
 specific bits

On 12/07, Viresh Kumar wrote:
> @@ -137,15 +121,18 @@ functions return the matching pointer representing the opp if a match is
>  found, else returns error. These errors are expected to be handled by standard
>  error checks such as IS_ERR() and appropriate actions taken by the caller.
>  
> +Callers of these functions shall call dev_pm_opp_put() after they have used the
> +OPP. Otherwise the memory for the OPP will never get freed and result in
> +memleak.
> +
>  dev_pm_opp_find_freq_exact - Search for an OPP based on an *exact* frequency and
>  	availability. This function is especially useful to enable an OPP which
>  	is not available by default.
>  	Example: In a case when SoC framework detects a situation where a
>  	higher frequency could be made available, it can use this function to
>  	find the OPP prior to call the dev_pm_opp_enable to actually make it available.
> -	 rcu_read_lock();
>  	 opp = dev_pm_opp_find_freq_exact(dev, 1000000000, false);
> -	 rcu_read_unlock();
> +	 dev_pm_opp_put(opp);
>  	 /* dont operate on the pointer.. just do a sanity check.. */
>  	 if (IS_ERR(opp)) {
>  		pr_err("frequency not disabled!\n");
> @@ -163,9 +150,8 @@ dev_pm_opp_find_freq_floor - Search for an available OPP which is *at most* the
>  	frequency.
>  	Example: To find the highest opp for a device:
>  	 freq = ULONG_MAX;
> -	 rcu_read_lock();
>  	 dev_pm_opp_find_freq_floor(dev, &freq);
> -	 rcu_read_unlock();
> +	 dev_pm_opp_put(opp);

opp doesn't exist in the scope here. Missing an assignment during
the dev_pm_opp_find_freq_floor() call?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ