]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
module: Remove unnecessary +1 from last_unloaded_module::name size
authorPetr Pavlu <petr.pavlu@suse.com>
Mon, 30 Jun 2025 14:32:33 +0000 (16:32 +0200)
committerDaniel Gomez <da.gomez@samsung.com>
Thu, 31 Jul 2025 11:57:32 +0000 (13:57 +0200)
The variable last_unloaded_module::name tracks the name of the last
unloaded module. It is a string copy of module::name, which is
MODULE_NAME_LEN bytes in size and includes the NUL terminator. Therefore,
the size of last_unloaded_module::name can also be just MODULE_NAME_LEN,
without the need for an extra byte.

Fixes: e14af7eeb47e ("debug: track and print last unloaded module in the oops trace")
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
Link: https://lore.kernel.org/r/20250630143535.267745-3-petr.pavlu@suse.com
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
kernel/module/main.c

index 120e51550a88755d2c87dee68e089f1bd0acc190..7f8bb51aedd47d1b3470f3beaa2d92d987dc54a6 100644 (file)
@@ -608,7 +608,7 @@ MODINFO_ATTR(version);
 MODINFO_ATTR(srcversion);
 
 static struct {
-       char name[MODULE_NAME_LEN + 1];
+       char name[MODULE_NAME_LEN];
        char taints[MODULE_FLAGS_BUF_SIZE];
 } last_unloaded_module;