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