Skip to content

Commit 7852809

Browse files
arndbchucklever
authored andcommitted
sunrpc: avoid -Wformat-security warning
Using a non-constant string as an sprintf-style is potentially dangerous: net/sunrpc/svc.c: In function 'param_get_pool_mode': net/sunrpc/svc.c:164:32: error: format not a string literal and no format arguments [-Werror=format-security] Use a literal "%s" format instead. Fixes: 5f71f3c ("sunrpc: refactor pool_mode setting code") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 769d200 commit 7852809

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sunrpc/svc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ param_get_pool_mode(char *buf, const struct kernel_param *kp)
161161
str[len] = '\n';
162162
str[len + 1] = '\0';
163163

164-
return sysfs_emit(buf, str);
164+
return sysfs_emit(buf, "%s", str);
165165
}
166166

167167
module_param_call(pool_mode, param_set_pool_mode, param_get_pool_mode,

0 commit comments

Comments
 (0)