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

Showing the changes to kernel/module.c (1 of 1 file). Show all

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
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:

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