diff options
Diffstat (limited to 'lib/bug.c')
-rw-r--r-- | lib/bug.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -72,8 +72,8 @@ static const struct bug_entry *module_find_bug(unsigned long bugaddr) | |||
72 | return NULL; | 72 | return NULL; |
73 | } | 73 | } |
74 | 74 | ||
75 | int module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, | 75 | void module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, |
76 | struct module *mod) | 76 | struct module *mod) |
77 | { | 77 | { |
78 | char *secstrings; | 78 | char *secstrings; |
79 | unsigned int i; | 79 | unsigned int i; |
@@ -97,8 +97,6 @@ int module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, | |||
97 | * could potentially lead to deadlock and thus be counter-productive. | 97 | * could potentially lead to deadlock and thus be counter-productive. |
98 | */ | 98 | */ |
99 | list_add(&mod->bug_list, &module_bug_list); | 99 | list_add(&mod->bug_list, &module_bug_list); |
100 | |||
101 | return 0; | ||
102 | } | 100 | } |
103 | 101 | ||
104 | void module_bug_cleanup(struct module *mod) | 102 | void module_bug_cleanup(struct module *mod) |
@@ -136,8 +134,6 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) | |||
136 | 134 | ||
137 | bug = find_bug(bugaddr); | 135 | bug = find_bug(bugaddr); |
138 | 136 | ||
139 | printk(KERN_EMERG "------------[ cut here ]------------\n"); | ||
140 | |||
141 | file = NULL; | 137 | file = NULL; |
142 | line = 0; | 138 | line = 0; |
143 | warning = 0; | 139 | warning = 0; |
@@ -156,19 +152,25 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) | |||
156 | 152 | ||
157 | if (warning) { | 153 | if (warning) { |
158 | /* this is a WARN_ON rather than BUG/BUG_ON */ | 154 | /* this is a WARN_ON rather than BUG/BUG_ON */ |
155 | printk(KERN_WARNING "------------[ cut here ]------------\n"); | ||
156 | |||
159 | if (file) | 157 | if (file) |
160 | printk(KERN_ERR "Badness at %s:%u\n", | 158 | printk(KERN_WARNING "WARNING: at %s:%u\n", |
161 | file, line); | 159 | file, line); |
162 | else | 160 | else |
163 | printk(KERN_ERR "Badness at %p " | 161 | printk(KERN_WARNING "WARNING: at %p " |
164 | "[verbose debug info unavailable]\n", | 162 | "[verbose debug info unavailable]\n", |
165 | (void *)bugaddr); | 163 | (void *)bugaddr); |
166 | 164 | ||
165 | print_modules(); | ||
167 | show_regs(regs); | 166 | show_regs(regs); |
167 | print_oops_end_marker(); | ||
168 | add_taint(BUG_GET_TAINT(bug)); | 168 | add_taint(BUG_GET_TAINT(bug)); |
169 | return BUG_TRAP_TYPE_WARN; | 169 | return BUG_TRAP_TYPE_WARN; |
170 | } | 170 | } |
171 | 171 | ||
172 | printk(KERN_EMERG "------------[ cut here ]------------\n"); | ||
173 | |||
172 | if (file) | 174 | if (file) |
173 | printk(KERN_CRIT "kernel BUG at %s:%u!\n", | 175 | printk(KERN_CRIT "kernel BUG at %s:%u!\n", |
174 | file, line); | 176 | file, line); |