[PATCH] arm: fix a preempt_count() corruption for

From: Patrik Kluba
Date: Fri Dec 14 2012 - 08:36:27 EST


All the preempt-disabling assembly code is under CONFIG_PREEMPT,
while VFP_bounce calls preempt_enable() uncoditionally, leading to
a preempt_count() corruption (gets set to 0xffffffff). Fix the
imbalance by adding #ifdef CONFIG_PREEMPT before preempt_enable().
---
arch/arm/vfp/vfpmodule.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 3b44e0d..2184f7e 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -428,7 +428,10 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct
pt_regs *regs) if (exceptions)
vfp_raise_exceptions(exceptions, trigger, orig_fpscr,
regs); exit:
+#ifdef CONFIG_PREEMPT
preempt_enable();
+#endif
+ return;
}

static void vfp_enable(void *unused)
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/