]> git.baikalelectronics.ru Git - kernel.git/commit
module: avoid setting info->name early in case we can fall back to info->mod->name
authorJessica Yu <jeyu@kernel.org>
Fri, 17 Jan 2020 12:32:21 +0000 (13:32 +0100)
committerJessica Yu <jeyu@kernel.org>
Mon, 20 Jan 2020 15:59:39 +0000 (16:59 +0100)
commit3691f3b881c7dbe0cebb4d08e6e1ac57f1a0f4a1
tree1d48125bdee9fdac04df6f33209acf21c9d6a8ed
parent070645a3cd5dbc09a8d4d848be95bf5ab559a08b
module: avoid setting info->name early in case we can fall back to info->mod->name

In setup_load_info(), info->name (which contains the name of the module,
mostly used for early logging purposes before the module gets set up)
gets unconditionally assigned if .modinfo is missing despite the fact
that there is an if (!info->name) check near the end of the function.
Avoid assigning a placeholder string to info->name if .modinfo doesn't
exist, so that we can fall back to info->mod->name later on.

Fixes: 737fce0d7f54 ("module: setup load info before module_sig_check()")
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
kernel/module.c