]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sparc64: Fix offset calculation in compute_size()
authorDavid S. Miller <davem@davemloft.net>
Mon, 1 Dec 2008 10:48:26 +0000 (02:48 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 13 Dec 2008 23:29:12 +0000 (15:29 -0800)
[ 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

index 19d1fdb17d0e8b4f5b3ac6ce0a72fe7c11c65a6b..05a361b0a1a40e6d87ad6c86d59ab464fd48e4c5 100644 (file)
@@ -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;