diff options
| author | Heiko Carstens <hca@linux.ibm.com> | 2025-12-08 21:06:58 +0100 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2025-12-09 10:14:46 +0100 |
| commit | 477fa55e3de7c40ba47f10c837c6a32e300893a1 (patch) | |
| tree | 10d78697a01fc3a9749b311cc23aa5356620c995 /lib/bug.c | |
| parent | cb015814f8b6eebcbb8e46e111d108892c5e6821 (diff) | |
| download | tip-477fa55e3de7c40ba47f10c837c6a32e300893a1.tar.gz | |
bug: Let report_but_entry() provide the correct bugaddr
Notice: this object is not reachable from any branch.
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: 7d2c27a0ec5e ("bug: Add report_bug_entry()")
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251208200658.3431511-1-hca@linux.ibm.com
Notice: this object is not reachable from any branch.
Diffstat (limited to 'lib/bug.c')
| -rw-r--r-- | lib/bug.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bug.c b/lib/bug.c index edd9041f89f3aa..c6f691f3d42d2d 100644 --- a/lib/bug.c +++ b/lib/bug.c @@ -262,7 +262,7 @@ enum bug_trap_type report_bug_entry(struct bug_entry *bug, struct pt_regs *regs) bool rcu = false; rcu = warn_rcu_enter(); - ret = __report_bug(bug, 0, regs); + ret = __report_bug(bug, bug_addr(bug), regs); warn_rcu_exit(rcu); return ret; |
