mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
mm, mempolicy: silence gcc warning
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. Signed-off-by: David Rientjes <rientjes@google.com> Reported-by: Fengguang Wu <fengguang.wu@intel.com> Suggested-by: Kees Cook <keescook@chromium.org> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
49204c116a
commit
b7a9f420ed
@ -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, "=");
|
||||
|
Loading…
Reference in New Issue
Block a user