Commit d0f95c78 authored by Namhyung Kim's avatar Namhyung Kim Committed by Michal Marek

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: default avatarNamhyung Kim <namhyung@gmail.com>
Acked-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent b74b953b
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment