]> Git Repo - linux.git/commitdiff
ARM: unwinder: fix bisection to find origin in .idx section
authorUwe Kleine-König <[email protected]>
Thu, 15 Dec 2011 20:47:56 +0000 (21:47 +0100)
committerLinus Torvalds <[email protected]>
Thu, 15 Dec 2011 22:02:19 +0000 (14:02 -0800)
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 commit de66a979012d ("ARM: 7187/1: fix unwinding
for XIP kernels").

Reported-and-tested-by: Nick Bowler <[email protected]>
Signed-off-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
arch/arm/kernel/unwind.c

index 3f03fe0c3269d9993ece6e05ae47439605a4ff1c..00df012c46784ac8c510466f1a4124158c3f86a3 100644 (file)
@@ -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;
This page took 0.060862 seconds and 4 git commands to generate.