diff options
author | 2025-06-30 16:32:33 +0200 | |
---|---|---|
committer | 2025-07-31 13:57:32 +0200 | |
commit | 6c171b2ccfe677ca97fc5334f853807959f26589 (patch) | |
tree | 47475dd442a2305819356954556e85d70103d0fb | |
parent | module: Prevent silent truncation of module name in delete_module(2) (diff) | |
download | wireguard-linux-6c171b2ccfe677ca97fc5334f853807959f26589.tar.xz wireguard-linux-6c171b2ccfe677ca97fc5334f853807959f26589.zip |
module: Remove unnecessary +1 from last_unloaded_module::name size
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>
-rw-r--r-- | kernel/module/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/module/main.c b/kernel/module/main.c index 120e51550a88..7f8bb51aedd4 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -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; |