summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2024-10-16 11:15:20 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-19 09:57:04 +0200
commitd76e1402ec453cfbface5240f74c783ef0aa1985 (patch)
treeb30b13abf77fee87c80916698f09728bf19055f1
parent2c9f5d8c6ece91ecd33350749230494d224550f1 (diff)
downloadlinux-d76e1402ec453cfbface5240f74c783ef0aa1985.tar.gz
linux-d76e1402ec453cfbface5240f74c783ef0aa1985.zip
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>
-rw-r--r--drivers/staging/gpib/common/gpib_os.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index e93a45132a40..6b12404efe7d 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -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);