Title: [7921] trunk/scripts/mod/modpost.c: modpost: fix asprintf warnings
Revision
7921
Author
vapier
Date
2009-12-03 17:58:11 -0500 (Thu, 03 Dec 2009)

Log Message

modpost: fix asprintf warnings

scripts/mod/modpost.c: In function 'get_markers':
scripts/mod/modpost.c:1562: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result
scripts/mod/modpost.c: In function 'add_marker':
scripts/mod/modpost.c:1982: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result

Modified Paths

Diff

Modified: trunk/scripts/mod/modpost.c (7920 => 7921)


--- trunk/scripts/mod/modpost.c	2009-12-03 22:54:40 UTC (rev 7920)
+++ trunk/scripts/mod/modpost.c	2009-12-03 22:58:11 UTC (rev 7921)
@@ -1559,7 +1559,8 @@
 			const char *name = strings + sym->st_value;
 			const char *fmt = strchr(name, '\0') + 1;
 			char *line = NULL;
-			asprintf(&line, "%s\t%s\t%s\n", name, mod->name, fmt);
+			if (asprintf(&line, "%s\t%s\t%s\n", name, mod->name, fmt) == -1)
+				fatal("asprintf() with %s failed", name);
 			NOFAIL(line);
 			mod->markers[n++] = line;
 		}
@@ -1979,7 +1980,8 @@
 static void add_marker(struct module *mod, const char *name, const char *fmt)
 {
 	char *line = NULL;
-	asprintf(&line, "%s\t%s\t%s\n", name, mod->name, fmt);
+	if (asprintf(&line, "%s\t%s\t%s\n", name, mod->name, fmt) == -1)
+		fatal("asprintf() with %s failed", name);
 	NOFAIL(line);
 
 	mod->markers = NOFAIL(realloc(mod->markers, ((mod->nmarkers + 1) *
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to