History

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.

Jason A. Donenfeld committed 8 years ago

Commit 62267e01 parent 5fdc7db1 file · +2 −2Browse files

Unified · Split

kernel/module.c+2−2
@@ -2284,9 +2284,9 @@ static int simplify_symbols(struct module *mod, const struct load_info *info) · 2283 unmodified lines
2284 if (!ksym && ELF_ST_BIND(sym[i].st_info) == STB_WEAK)2284 if (!ksym && ELF_ST_BIND(sym[i].st_info) == STB_WEAK)
2285 break;2285 break;
2286 2286
2287 pr_warn("%s: Unknown symbol %s (err %li)\n",
2288 mod->name, name, PTR_ERR(ksym));
2289 ret = PTR_ERR(ksym) ?: -ENOENT;2287 ret = PTR_ERR(ksym) ?: -ENOENT;
2288 pr_warn("%s: Unknown symbol %s (err %d)\n",
2289 mod->name, name, ret);
2290 break;2290 break;
2291 2291
2292 default:2292 default:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t