linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch -mm] mm, mempolicy: silence gcc warning
@ 2013-11-13  2:12 David Rientjes
  2013-11-13 19:20 ` Kees Cook
  2013-11-20 22:15 ` Andrew Morton
  0 siblings, 2 replies; 11+ messages in thread
From: David Rientjes @ 2013-11-13  2:12 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Fengguang Wu, Kees Cook, KOSAKI Motohiro, Rik van Riel, linux-mm

Fengguang Wu reports that compiling mm/mempolicy.c results in a warning:

	mm/mempolicy.c: In function 'mpol_to_str':
	mm/mempolicy.c:2878:2: error: format not a string literal and no format arguments

Kees says this is because he is using -Wformat-security.

Silence the warning.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Suggested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/mempolicy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2950,7 +2950,7 @@ void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)
 		return;
 	}
 
-	p += snprintf(p, maxlen, policy_modes[mode]);
+	p += snprintf(p, maxlen, "%s", policy_modes[mode]);
 
 	if (flags & MPOL_MODE_FLAGS) {
 		p += snprintf(p, buffer + maxlen - p, "=");

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-11-26 18:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-13  2:12 [patch -mm] mm, mempolicy: silence gcc warning David Rientjes
2013-11-13 19:20 ` Kees Cook
2013-11-20 22:15 ` Andrew Morton
2013-11-20 22:19   ` Kees Cook
2013-11-23 20:49   ` KOSAKI Motohiro
2013-11-25 20:31     ` Andrew Morton
2013-11-25 23:30       ` David Rientjes
2013-11-25 23:33         ` [patch] mm, mempolicy: remove unneeded functions for UMA configs David Rientjes
2013-11-26  0:08       ` [patch -mm] mm, mempolicy: silence gcc warning KOSAKI Motohiro
2013-11-26  0:20         ` Andrew Morton
2013-11-26 18:40           ` KOSAKI Motohiro

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).