From: "Heiko Stübner" <heiko@sntech.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Kukjin Kim <kgene@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Javier Martinez Canillas <javier@osg.samsung.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Viresh Kumar <viresh.kumar@linaro.org>,
linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] cpufreq: s3c2416: double free on driver init error path
Date: Thu, 09 Feb 2017 12:44:11 +0000 [thread overview]
Message-ID: <4549666.o9M1oGfALz@diego> (raw)
In-Reply-To: <20170207131906.GD27416@mwanda>
Hi Dan,
Am Dienstag, 7. Februar 2017, 16:19:06 CET schrieb Dan Carpenter:
> The "goto err_armclk;" error path already does a clk_put(s3c_freq->hclk);
> so this is a double free.
>
> Fixes: 34ee55075265 ("[CPUFREQ] Add S3C2416/S3C2450 cpufreq driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Interesting, you found a mistake I made 5 years ago.
It always amazes me how much time I already spent in kernel-land :-) .
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Thanks for finding and fixing this
Heiko
> diff --git a/drivers/cpufreq/s3c2416-cpufreq.c
> b/drivers/cpufreq/s3c2416-cpufreq.c index d6d425773fa4..5b2db3c6568f 100644
> --- a/drivers/cpufreq/s3c2416-cpufreq.c
> +++ b/drivers/cpufreq/s3c2416-cpufreq.c
> @@ -400,7 +400,6 @@ static int s3c2416_cpufreq_driver_init(struct
> cpufreq_policy *policy) rate = clk_get_rate(s3c_freq->hclk);
> if (rate < 133 * 1000 * 1000) {
> pr_err("cpufreq: HCLK not at 133MHz\n");
> - clk_put(s3c_freq->hclk);
> ret = -EINVAL;
> goto err_armclk;
> }
WARNING: multiple messages have this Message-ID (diff)
From: "Heiko Stübner" <heiko@sntech.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Kukjin Kim <kgene@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Javier Martinez Canillas <javier@osg.samsung.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Viresh Kumar <viresh.kumar@linaro.org>,
linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] cpufreq: s3c2416: double free on driver init error path
Date: Thu, 09 Feb 2017 13:44:11 +0100 [thread overview]
Message-ID: <4549666.o9M1oGfALz@diego> (raw)
In-Reply-To: <20170207131906.GD27416@mwanda>
Hi Dan,
Am Dienstag, 7. Februar 2017, 16:19:06 CET schrieb Dan Carpenter:
> The "goto err_armclk;" error path already does a clk_put(s3c_freq->hclk);
> so this is a double free.
>
> Fixes: 34ee55075265 ("[CPUFREQ] Add S3C2416/S3C2450 cpufreq driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Interesting, you found a mistake I made 5 years ago.
It always amazes me how much time I already spent in kernel-land :-) .
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Thanks for finding and fixing this
Heiko
> diff --git a/drivers/cpufreq/s3c2416-cpufreq.c
> b/drivers/cpufreq/s3c2416-cpufreq.c index d6d425773fa4..5b2db3c6568f 100644
> --- a/drivers/cpufreq/s3c2416-cpufreq.c
> +++ b/drivers/cpufreq/s3c2416-cpufreq.c
> @@ -400,7 +400,6 @@ static int s3c2416_cpufreq_driver_init(struct
> cpufreq_policy *policy) rate = clk_get_rate(s3c_freq->hclk);
> if (rate < 133 * 1000 * 1000) {
> pr_err("cpufreq: HCLK not at 133MHz\n");
> - clk_put(s3c_freq->hclk);
> ret = -EINVAL;
> goto err_armclk;
> }
next prev parent reply other threads:[~2017-02-09 12:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-07 13:19 [patch] cpufreq: s3c2416: double free on driver init error path Dan Carpenter
2017-02-07 13:19 ` Dan Carpenter
2017-02-07 20:29 ` Krzysztof Kozlowski
2017-02-07 20:29 ` Krzysztof Kozlowski
2017-02-08 3:24 ` Viresh Kumar
2017-02-08 3:36 ` Viresh Kumar
2017-02-09 12:44 ` Heiko Stübner [this message]
2017-02-09 12:44 ` Heiko Stübner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4549666.o9M1oGfALz@diego \
--to=heiko@sntech.de \
--cc=dan.carpenter@oracle.com \
--cc=javier@osg.samsung.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kgene@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.