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] [day] [month] [year] [list]
Message-ID: <13108044.7jpZQWdzkb@aspire.rjw.lan>
Date:   Mon, 28 Aug 2017 23:21:07 +0200
From:   "Rafael J. Wysocki" <rjw@...ysocki.net>
To:     Viresh Kumar <viresh.kumar@...aro.org>,
        Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] cpufreq: ti: Fix 'of_node_put' being called twice in error handling path

On Sunday, August 20, 2017 3:21:06 PM CEST Viresh Kumar wrote:
> On 19-08-17, 22:22, Christophe JAILLET wrote:
> > If 'dev_pm_opp_set_supported_hw()' fails, 'opp_data->opp_node' refcount
> > will be decremented 2 times.
> > One, just a few lines above, and another one in the error handling path.
> > 
> > Fix it by simply moving the 'of_node_put' call of the normal path.
> > 
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> > ---
> >  drivers/cpufreq/ti-cpufreq.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c
> > index a7b5658c0460..b29cd3398463 100644
> > --- a/drivers/cpufreq/ti-cpufreq.c
> > +++ b/drivers/cpufreq/ti-cpufreq.c
> > @@ -245,8 +245,6 @@ static int ti_cpufreq_init(void)
> >  	if (ret)
> >  		goto fail_put_node;
> >  
> > -	of_node_put(opp_data->opp_node);
> > -
> >  	ret = PTR_ERR_OR_ZERO(dev_pm_opp_set_supported_hw(opp_data->cpu_dev,
> >  							  version, VERSION_COUNT));
> >  	if (ret) {
> > @@ -255,6 +253,8 @@ static int ti_cpufreq_init(void)
> >  		goto fail_put_node;
> >  	}
> >  
> > +	of_node_put(opp_data->opp_node);
> > +
> >  register_cpufreq_dt:
> >  	platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
> 
> Acked-by: Viresh Kumar <viresh.kumar@...aro.org>
> 
> 

Applied, thanks!


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ