Skip to content

Commit b5e51ef

Browse files
hcahcaingomolnar
authored andcommitted
bug: Let report_bug_entry() provide the correct bugaddr
report_bug_entry() always provides zero for bugaddr but could easily extract the correct address from the provided bug_entry. Just do that to have proper warning messages. E.g. adding an artificial: void foo(void) { WARN_ONCE(1, "bar"); } function generates this warning message: WARNING: arch/s390/kernel/setup.c:1017 at 0x0, CPU#0: swapper/0/0 ^^^ With the correct bug address this changes to: WARNING: arch/s390/kernel/setup.c:1017 at foo+0x1c/0x40, CPU#0: swapper/0/0 ^^^^^^^^^^^^^ Fixes: 7d2c27a ("bug: Add report_bug_entry()") Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://patch.msgid.link/20251208200658.3431511-1-hca@linux.ibm.com
1 parent 0048fbb commit b5e51ef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/bug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ enum bug_trap_type report_bug_entry(struct bug_entry *bug, struct pt_regs *regs)
262262
bool rcu = false;
263263

264264
rcu = warn_rcu_enter();
265-
ret = __report_bug(bug, 0, regs);
265+
ret = __report_bug(bug, bug_addr(bug), regs);
266266
warn_rcu_exit(rcu);
267267

268268
return ret;

0 commit comments

Comments
 (0)