Skip to content

Commit 62267e0

Browse files
zx2c4Jessica Yu
authored andcommitted
module: print sensible error code
Printing "err 0" to the user in the warning message is not particularly useful, especially when this gets transformed into a -ENOENT for the remainder of the call chain. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Jessica Yu <jeyu@kernel.org>
1 parent 5fdc7db commit 62267e0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎kernel/module.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,9 +2284,9 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
22842284
if (!ksym && ELF_ST_BIND(sym[i].st_info) == STB_WEAK)
22852285
break;
22862286

2287-
pr_warn("%s: Unknown symbol %s (err %li)\n",
2288-
mod->name, name, PTR_ERR(ksym));
22892287
ret = PTR_ERR(ksym) ?: -ENOENT;
2288+
pr_warn("%s: Unknown symbol %s (err %d)\n",
2289+
mod->name, name, ret);
22902290
break;
22912291

22922292
default:

0 commit comments

Comments
 (0)