aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/basic
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2010-10-22 10:32:10 -0400
committerMichal Marek <mmarek@suse.cz>2010-10-27 18:17:16 -0400
commitd0f95c782686dbfbb415d533881a06c2bde17ee0 (patch)
tree9fbe99adf30921b2474944cd90c11b7f11ee8dcb /scripts/basic
parentb74b953b998bcc2db91b694446f3a2619ec32de6 (diff)
kbuild: check return value of asprintf()
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> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/basic')
-rw-r--r--scripts/basic/docproc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c
index fc3b18d844af..98dec87974d0 100644
--- a/scripts/basic/docproc.c
+++ b/scripts/basic/docproc.c
@@ -333,7 +333,10 @@ static void docsect(char *filename, char *line)
333 if (*s == '\n') 333 if (*s == '\n')
334 *s = '\0'; 334 *s = '\0';
335 335
336 asprintf(&s, "DOC: %s", line); 336 if (asprintf(&s, "DOC: %s", line) < 0) {
337 perror("asprintf");
338 exit(1);
339 }
337 consume_symbol(s); 340 consume_symbol(s);
338 free(s); 341 free(s);
339 342