From: Randy Dunlap <randy.dunlap@oracle.com>
To: Michal Marek <mmarek@suse.cz>
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: Mon, 25 Oct 2010 07:42:45 -0700 [thread overview]
Message-ID: <4CC59765.5080908@oracle.com> (raw)
In-Reply-To: <4CC54E4D.7040401@suse.cz>
On 10/25/10 02:30, Michal Marek wrote:
> (adding Randy to CC)
Thanks, Michal.
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
> 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);
>>
>
--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
next prev parent reply other threads:[~2010-10-25 14:43 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 [this message]
2010-10-27 22:18 ` Michal Marek
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=4CC59765.5080908@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=namhyung@gmail.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