Skip to content

Commit

Permalink
module: print sensible error code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
zx2c4 authored and Jessica Yu committed Jun 25, 2018
1 parent 5fdc7db commit 62267e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -2284,9 +2284,9 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
if (!ksym && ELF_ST_BIND(sym[i].st_info) == STB_WEAK)
break;

pr_warn("%s: Unknown symbol %s (err %li)\n",
mod->name, name, PTR_ERR(ksym));
ret = PTR_ERR(ksym) ?: -ENOENT;
pr_warn("%s: Unknown symbol %s (err %d)\n",
mod->name, name, ret);
break;

default:
Expand Down

0 comments on commit 62267e0

Please sign in to comment.