diff options
Diffstat (limited to 'arch/um/kernel/skas/uaccess.c')
-rw-r--r-- | arch/um/kernel/skas/uaccess.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/um/kernel/skas/uaccess.c b/arch/um/kernel/skas/uaccess.c index f7da9d027672..75195281081e 100644 --- a/arch/um/kernel/skas/uaccess.c +++ b/arch/um/kernel/skas/uaccess.c | |||
@@ -29,9 +29,12 @@ static unsigned long maybe_map(unsigned long virt, int is_write) | |||
29 | if(IS_ERR(phys) || (is_write && !pte_write(pte))){ | 29 | if(IS_ERR(phys) || (is_write && !pte_write(pte))){ |
30 | err = handle_page_fault(virt, 0, is_write, 1, &dummy_code); | 30 | err = handle_page_fault(virt, 0, is_write, 1, &dummy_code); |
31 | if(err) | 31 | if(err) |
32 | return(0); | 32 | return(-1UL); |
33 | phys = um_virt_to_phys(current, virt, NULL); | 33 | phys = um_virt_to_phys(current, virt, NULL); |
34 | } | 34 | } |
35 | if(IS_ERR(phys)) | ||
36 | phys = (void *) -1; | ||
37 | |||
35 | return((unsigned long) phys); | 38 | return((unsigned long) phys); |
36 | } | 39 | } |
37 | 40 | ||
@@ -42,7 +45,7 @@ static int do_op(unsigned long addr, int len, int is_write, | |||
42 | int n; | 45 | int n; |
43 | 46 | ||
44 | addr = maybe_map(addr, is_write); | 47 | addr = maybe_map(addr, is_write); |
45 | if(addr == -1) | 48 | if(addr == -1UL) |
46 | return(-1); | 49 | return(-1); |
47 | 50 | ||
48 | page = phys_to_page(addr); | 51 | page = phys_to_page(addr); |