mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
staging: gpib: use proper format string in request_module
Using a string variable as a format causes a -Wformat-security warning. Since the only use of the temporary module_string[] is to hold the sprintf() output, just pass the format string and argument directly to request_module(). Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20241016111521.1143191-7-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2c9f5d8c6e
commit
d76e1402ec
@@ -599,11 +599,9 @@ int ibopen(struct inode *inode, struct file *filep)
|
||||
GPIB_DPRINTK("pid %i, gpib: opening minor %d\n", current->pid, minor);
|
||||
|
||||
if (board->use_count == 0) {
|
||||
char module_string[32];
|
||||
int retval;
|
||||
|
||||
snprintf(module_string, sizeof(module_string), "gpib%i", minor);
|
||||
retval = request_module(module_string);
|
||||
retval = request_module("gpib%i", minor);
|
||||
if (retval) {
|
||||
GPIB_DPRINTK("pid %i, gpib: request module returned %i\n",
|
||||
current->pid, retval);
|
||||
|
||||
Reference in New Issue
Block a user