From: Javi Merino <javi.merino@arm.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Zhang Rui <rui.zhang@intel.com>,
Eduardo Valentin <edubezval@gmail.com>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>
Subject: Re: [patch] thermal: cpu_cooling: check for allocation failure
Date: Mon, 30 Mar 2015 12:23:22 +0000 [thread overview]
Message-ID: <20150330122322.GB11519@e104805> (raw)
In-Reply-To: <20150330112144.GC27144@mwanda>
On Mon, Mar 30, 2015 at 12:21:44PM +0100, Dan Carpenter wrote:
> If this fails, then we're likely in trouble anyway, but it's nice to
> keep the code free from static checker warnings so you don't miss more
> important bugs.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
> index c497414..3a01dfd 100644
> --- a/drivers/thermal/cpu_cooling.c
> +++ b/drivers/thermal/cpu_cooling.c
> @@ -329,6 +329,10 @@ static int build_dyn_power_table(struct cpufreq_cooling_device *cpufreq_device,
> }
>
> power_table = kcalloc(num_opps, sizeof(*power_table), GFP_KERNEL);
> + if (!power_table) {
> + ret = -ENOMEM;
> + goto unlock;
> + }
This fix is already in Eduardo's tree and is scheduled for 4.1:
https://git.kernel.org/cgit/linux/kernel/git/evalenti/linux-soc-thermal.git/commit/?h=linus&idea7db8371d1203adb871d240d46b040fd6b4e1d
Cheers,
Javi
prev parent reply other threads:[~2015-03-30 12:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-30 11:21 [patch] thermal: cpu_cooling: check for allocation failure Dan Carpenter
2015-03-30 12:23 ` Javi Merino [this message]
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=20150330122322.GB11519@e104805 \
--to=javi.merino@arm.com \
--cc=dan.carpenter@oracle.com \
--cc=edubezval@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox