From: Jason A. Donenfeld Date: Fri, 22 Jun 2018 15:38:50 +0000 (+0200) Subject: module: print sensible error code X-Git-Tag: v4.19-rc1~111^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62267e0ecc9c00a1b8ff7859cfa03e34b419f7ee;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Jessica Yu --- diff --git a/kernel/module.c b/kernel/module.c index 0ad0bb58e116b..b6b3a3c58af1a 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -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: