diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2011-12-15 21:47:56 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-15 23:02:19 +0100 |
commit | ddf5a25c5fdd4cc276edf451871c38002eec0f95 (patch) | |
tree | 6262274a4299ace9b83bc14649049f405c348df0 /arch/arm/kernel/unwind.c | |
parent | Merge branch 'stable/for-linus-fixes-3.2' of git://git.kernel.org/pub/scm/lin... (diff) | |
download | linux-ddf5a25c5fdd4cc276edf451871c38002eec0f95.tar.xz linux-ddf5a25c5fdd4cc276edf451871c38002eec0f95.zip |
ARM: unwinder: fix bisection to find origin in .idx section
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 <nbowler@elliptictech.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r-- | 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 3f03fe0c3269..00df012c4678 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; |