diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2022-05-30 11:01:38 +0200 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2022-06-04 23:20:57 +0200 |
commit | 8c9ce89c5b63028dd3be43807f10b009cd2c6e51 (patch) | |
tree | 05718b142e802d81023a13df9b75aee0dc692f83 /sound/ac97 | |
parent | kbuild: factor out the common objtool arguments (diff) | |
download | linux-8c9ce89c5b63028dd3be43807f10b009cd2c6e51.tar.xz linux-8c9ce89c5b63028dd3be43807f10b009cd2c6e51.zip |
modpost: simplify mod->name allocation
mod->name is set to the ELF filename with the suffix ".o" stripped.
The current code calls strdup() and free() to manipulate the string,
but a simpler approach is to pass new_module() with the name length
subtracted by 2.
Also, check if the passed filename ends with ".o" before stripping it.
The current code blindly chops the suffix:
tmp[strlen(tmp) - 2] = '\0'
It will cause buffer under-run if strlen(tmp) < 2;
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Diffstat (limited to 'sound/ac97')
0 files changed, 0 insertions, 0 deletions