linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: arvind <arvind.yadav.cs@gmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>, Joe Perches <joe@perches.com>
Cc: vireshk@kernel.org, nm@ti.com, sboyd@codeaurora.org,
	rjw@rjwysocki.net, pavel@ucw.cz, len.brown@intel.com,
	gregkh@linuxfoundation.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PM / OPP: Handle return value of kasprintf
Date: Wed, 20 Sep 2017 22:28:36 +0530	[thread overview]
Message-ID: <59C29E3C.5010703@gmail.com> (raw)
In-Reply-To: <20170920144902.GL30848@ubuntu>

Hi,

On Wednesday 20 September 2017 08:19 PM, Viresh Kumar wrote:
> On 20-09-17, 04:17, Joe Perches wrote:
>> On Wed, 2017-09-20 at 12:29 +0530, Arvind Yadav wrote:
>>> kasprintf() can fail here and we must check its return value.
>> []
>>> diff --git a/drivers/base/power/opp/debugfs.c b/drivers/base/power/opp/debugfs.c
>> []
>>> @@ -45,7 +45,8 @@ static bool opp_debug_create_supplies(struct dev_pm_opp *opp,
>>>   
>>>   	for (i = 0; i < opp_table->regulator_count; i++) {
>>>   		name = kasprintf(GFP_KERNEL, "supply-%d", i);
>>> -
>>> +		if (!name)
>>> +			return false;
>>>   		/* Create per-opp directory */
>>>   		d = debugfs_create_dir(name, pdentry);
>> Probably more sensible to avoid the kasprintf/kfree
>> and just have
>> 	char name[20];
>> on the stack
> Sure.
>
> @Arvind: I will let you write that patch.
Yes, I will do.
>
~arvind

      reply	other threads:[~2017-09-20 16:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20  6:59 [PATCH] PM / OPP: Handle return value of kasprintf Arvind Yadav
2017-09-20 11:17 ` Joe Perches
2017-09-20 14:49   ` Viresh Kumar
2017-09-20 16:58     ` arvind [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=59C29E3C.5010703@gmail.com \
    --to=arvind.yadav.cs@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@codeaurora.org \
    --cc=viresh.kumar@linaro.org \
    --cc=vireshk@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).