Skip to content

Commit

Permalink
module: Use strscpy() for last_unloaded_module
Browse files Browse the repository at this point in the history
The use of strlcpy() is considered deprecated [1].
In this particular context, there is no need to remain with strlcpy().
Therefore we transition to strscpy().

[1]: https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy

Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
  • Loading branch information
Aaron Tomlin authored and Luis Chamberlain committed Jul 15, 2022
1 parent 17dd25c commit dbf0ae6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/module/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
async_synchronize_full();

/* Store the name of the last unloaded module for diagnostic purposes */
strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module));
strscpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module));

free_module(mod);
/* someone could wait for the module in add_unformed_module() */
Expand Down

0 comments on commit dbf0ae6

Please sign in to comment.