[PATCH 2/2] x86/mm/kmmio: Remove misleading ERR_PTR() cast
From: Habil Eren Türker
Date: Sun Sep 27 2026 - 10:30:10 EST
Same issue as the hw_breakpoint fix: arg->err holds the address of the
DR6 value, not an error pointer.
The ERR_PTR() cast is misleading and triggers a false positive from Smatch:
arch/x86/mm/kmmio.c:596 kmmio_die_notifier() error:
'dr6_p' dereferencing possible ERR_PTR()
While touching this line, also fix the "unsigned long*" spacing to
match kernel coding style.
No functional change.
Signed-off-by: Habil Eren Türker <habilerenturker@xxxxxxxxxxx>
---
arch/x86/mm/kmmio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
index 6ac981cec..88fb7af35 100644
--- a/arch/x86/mm/kmmio.c
+++ b/arch/x86/mm/kmmio.c
@@ -591,7 +591,7 @@ static int
kmmio_die_notifier(struct notifier_block *nb, unsigned long val, void *args)
{
struct die_args *arg = args;
- unsigned long* dr6_p = (unsigned long *)ERR_PTR(arg->err);
+ unsigned long *dr6_p = (unsigned long *)arg->err;
if (val == DIE_DEBUG && (*dr6_p & DR_STEP))
if (post_kmmio_handler(*dr6_p, arg->regs) == 1) {
--
2.47.3