mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-09-21 12:11:49 +08:00
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: 5f71f3c325
("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>
This commit is contained in:
parent
769d20028f
commit
7852809734
@ -161,7 +161,7 @@ param_get_pool_mode(char *buf, const struct kernel_param *kp)
|
||||
str[len] = '\n';
|
||||
str[len + 1] = '\0';
|
||||
|
||||
return sysfs_emit(buf, str);
|
||||
return sysfs_emit(buf, "%s", str);
|
||||
}
|
||||
|
||||
module_param_call(pool_mode, param_set_pool_mode, param_get_pool_mode,
|
||||
|
Loading…
Reference in New Issue
Block a user