From: Michal Marek <mmarek@suse.cz>
To: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Namhyung Kim <namhyung@gmail.com>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kbuild: check return value of asprintf()
Date: Thu, 28 Oct 2010 00:18:28 +0200 [thread overview]
Message-ID: <4CC8A534.80504@suse.cz> (raw)
In-Reply-To: <4CC59765.5080908@oracle.com>
On 25.10.2010 16:42, Randy Dunlap wrote:
> On 10/25/10 02:30, Michal Marek wrote:
>> (adding Randy to CC)
>
> Thanks, Michal.
>
> Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
OK, applied to kbuild-2.6.git#misc.
Michal
>
>
>> On 22.10.2010 16:32, Namhyung Kim wrote:
>>> Check return value of asprintf() in docsect() and exit if error
>>> occurs. This removes following warning:
>>>
>>> HOSTCC scripts/basic/docproc
>>> scripts/basic/docproc.c: In function ‘docsect’:
>>> scripts/basic/docproc.c:336: warning: ignoring return value of ‘asprintf’,
>>> declared with attribute warn_unused_result
>>>
>>> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
>>> ---
>>> The patch is on top of v2.6.36, thanks.
>>>
>>> scripts/basic/docproc.c | 5 ++++-
>>> 1 files changed, 4 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c
>>> index fc3b18d..98dec87 100644
>>> --- a/scripts/basic/docproc.c
>>> +++ b/scripts/basic/docproc.c
>>> @@ -333,7 +333,10 @@ static void docsect(char *filename, char *line)
>>> if (*s == '\n')
>>> *s = '\0';
>>>
>>> - asprintf(&s, "DOC: %s", line);
>>> + if (asprintf(&s, "DOC: %s", line) < 0) {
>>> + perror("asprintf");
>>> + exit(1);
>>> + }
>>> consume_symbol(s);
>>> free(s);
>>>
>>
>
>
prev parent reply other threads:[~2010-10-27 22:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-22 14:32 [PATCH] kbuild: check return value of asprintf() Namhyung Kim
2010-10-25 9:30 ` Michal Marek
2010-10-25 14:42 ` Randy Dunlap
2010-10-27 22:18 ` Michal Marek [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=4CC8A534.80504@suse.cz \
--to=mmarek@suse.cz \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@gmail.com \
--cc=randy.dunlap@oracle.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;
as well as URLs for NNTP newsgroup(s).