Skip to contentSkip to conversation

x86_64, traps: always true condition

PATCH Superseded Dan Carpenter 1 participant 2 messages Nov 25, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86_64, traps: always true condition

We should be checking IS_ERR() here. PTR_ERR() is always true.

Fixes b645af2d5905 ('x86_64, traps: Rework bad_iret')
arch/x86/kernel/traps.c +1 -1
index 67d817e..f176d96 100644
@@ -331,7 +331,7 @@ dotraplinkage void do_bounds(struct pt_regs *regs, long error_code)
 		break; /* Success, it was handled */
 	case 1: /* Bound violation. */
 		info = mpx_generate_siginfo(regs, xsave_buf);
-		if (PTR_ERR(info)) {
+		if (IS_ERR(info)) {
 			/*
 			 * We failed to decode the MPX instruction.  Act as if
 			 * the exception was not caused by MPX.
#1 lore raw
Quoted 10 lines · Andy Lutomirski
Quoted 4 lines · Dan Carpenter

We should be checking IS_ERR() here. PTR_ERR() is always true.

Fixes b645af2d5905 ('x86_64, traps: Rework bad_iret')

Huh?

I agree with the change, but the Fixes line looks wrong.

Oops. Sorry for that, it was the fe3d197f8431 ('x86, mpx: On-demand kernel allocation of bounds tables') change. I will resend.

regards,
dan carpenter