Skip to content

Commit 6c171b2

Browse files
petrpavludkruces
authored andcommitted
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: e14af7e ("debug: track and print last unloaded module in the oops trace") Signed-off-by: Petr Pavlu <[email protected]> Reviewed-by: Daniel Gomez <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Gomez <[email protected]>
1 parent a6323bd commit 6c171b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/module/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ MODINFO_ATTR(version);
608608
MODINFO_ATTR(srcversion);
609609

610610
static struct {
611-
char name[MODULE_NAME_LEN + 1];
611+
char name[MODULE_NAME_LEN];
612612
char taints[MODULE_FLAGS_BUF_SIZE];
613613
} last_unloaded_module;
614614

0 commit comments

Comments
 (0)