Commit 20a27827 authored by Linus Torvalds's avatar Linus Torvalds Committed by Christoph Hellwig

Avoid NULL ptr dereference on module names by always

having a valid name (base kernel: "").
parent 218af2f3
...@@ -52,7 +52,7 @@ EXPORT_SYMBOL(__stop___kallsyms); ...@@ -52,7 +52,7 @@ EXPORT_SYMBOL(__stop___kallsyms);
struct module kernel_module = struct module kernel_module =
{ {
.size_of_struct = sizeof(struct module), .size_of_struct = sizeof(struct module),
.name = NULL, .name = "",
.uc = {ATOMIC_INIT(1)}, .uc = {ATOMIC_INIT(1)},
.flags = MOD_RUNNING, .flags = MOD_RUNNING,
.syms = __start___ksymtab, .syms = __start___ksymtab,
...@@ -1353,7 +1353,7 @@ print_symbol(const char *fmt, unsigned long address) ...@@ -1353,7 +1353,7 @@ print_symbol(const char *fmt, unsigned long address)
} }
if (sym_start) { if (sym_start) {
if (mod_name) if (*mod_name)
snprintf(buffer, MAX_SYMBOL_SIZE - 1, "%s%s+%#x/%#x [%s]", snprintf(buffer, MAX_SYMBOL_SIZE - 1, "%s%s+%#x/%#x [%s]",
tag, sym_name, tag, sym_name,
(unsigned int)(address - sym_start), (unsigned int)(address - sym_start),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment