projects/linux·commit b270ee8a

sparc64: Fix offset calculation in compute_size()

b270ee8a · David S. Miller <[email protected]> · 2008-12-01 02:48:26 -08:00

The fault address is somewhere inside of the buffer, not
before it.

Signed-off-by: David S. Miller <[email protected]>
Commit
b270ee8a9fc9547eb781ce9ccd379450bcf9a204
Parents
be1ffce3

Changes

1 files changed · +1 −1

FileStatusAddDelContent
arch/sparc64/lib/user_fixup.cmodified+1−1View file

arch/sparc64/lib/user_fixup.c

View file
diff --git a/arch/sparc64/lib/user_fixup.c b/arch/sparc64/lib/user_fixup.c
index 19d1fdb..05a361b 100644
--- a/arch/sparc64/lib/user_fixup.c
+++ b/arch/sparc64/lib/user_fixup.c
@@ -24,7 +24,7 @@ static unsigned long compute_size(unsigned long start, unsigned long size, unsig
if (fault_addr < start || fault_addr >= end) {
*offset = 0;
} else {
- *offset = start - fault_addr;
+ *offset = fault_addr - start;
size = end - fault_addr;
}
return size;