All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: unwinder: fix bisection to find origin in .idx section
       [not found] <20111215145109.GA4143@elliptictech.com>
@ 2011-12-15 20:47 ` Uwe Kleine-König
  0 siblings, 0 replies; only message in thread
From: Uwe Kleine-König @ 2011-12-15 20:47 UTC (permalink / raw)
  To: linux-arm-kernel

The bisection implemented in unwind_find_origin() stopped to early. If
there is only a single entry left to check the original code just took
the end point as origin which might be wrong.

This was introduced in

	de66a97 (ARM: 7187/1: fix unwinding for XIP kernels)

Reported-by: Nick Bowler <nbowler@elliptictech.com>
Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
Hello Linus,

I suggested earlier to revert de66a97. I still think this is the safest
bet for 3.2. Anyhow here comes the fix that made Nick happy. If you
revert I'll fold it into my resubmission.

Best regards
Uwe

 arch/arm/kernel/unwind.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c
index 3f03fe0..00df012 100644
--- a/arch/arm/kernel/unwind.c
+++ b/arch/arm/kernel/unwind.c
@@ -160,12 +160,12 @@ static const struct unwind_idx *unwind_find_origin(
 		const struct unwind_idx *start, const struct unwind_idx *stop)
 {
 	pr_debug("%s(%p, %p)\n", __func__, start, stop);
-	while (start < stop - 1) {
+	while (start < stop) {
 		const struct unwind_idx *mid = start + ((stop - start) >> 1);
 
 		if (mid->addr_offset >= 0x40000000)
 			/* negative offset */
-			start = mid;
+			start = mid + 1;
 		else
 			/* positive offset */
 			stop = mid;
-- 
1.7.7.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-12-15 20:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20111215145109.GA4143@elliptictech.com>
2011-12-15 20:47 ` [PATCH] ARM: unwinder: fix bisection to find origin in .idx section Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.