[patch 07/83] sparc64: Fix offset calculation in compute_size()

Greg KH
2008-12-11T19:20:19Z

[-- Attachment #1: 0001-sparc64-Fix-offset-calculation-in-compute_size.patch --]
[-- Type: text/plain, Size: 795 bytes --]

2.6.27-stable review patch. If anyone has any objections, please let us know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit b270ee8a9fc9547eb781ce9ccd379450bcf9a204 ]

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

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
arch/sparc64/lib/user_fixup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/sparc64/lib/user_fixup.c
+++ b/arch/sparc64/lib/user_fixup.c
@@ -24,7 +24,7 @@ static unsigned long compute_size(unsign
if (fault_addr < start || fault_addr >= end) {
*offset = 0;
} else {
- *offset = start - fault_addr;
+ *offset = fault_addr - start;
size = end - fault_addr;
}
return size;