diff options
author | Claudio Imbrenda <[email protected]> | 2024-10-22 14:05:54 +0200 |
---|---|---|
committer | Heiko Carstens <[email protected]> | 2024-10-29 11:49:18 +0100 |
commit | 473aaf52b937e2401c7ad161a6197bf88e920a9a (patch) | |
tree | 2ba60cffd605414fcddd63029e11d99dc80685b5 | |
parent | 075fd7362ca082c85672687ed16cc7ed11c1578e (diff) |
s390/mm/gmap: Fix __gmap_fault() return code
Errors in fixup_user_fault() were masked and -EFAULT was returned for
any error, including out of memory.
Fix this by returning the correct error code. This means that in many
cases the error code will be propagated all the way to userspace.
Suggested-by: Heiko Carstens <[email protected]>
Signed-off-by: Claudio Imbrenda <[email protected]>
Reviewed-by: Heiko Carstens <[email protected]>
Acked-by: Alexander Gordeev <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Heiko Carstens <[email protected]>
-rw-r--r-- | arch/s390/mm/gmap.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c index f51ad948ba53..a8746f71c679 100644 --- a/arch/s390/mm/gmap.c +++ b/arch/s390/mm/gmap.c @@ -718,13 +718,12 @@ retry: if (IS_ERR_VALUE(vmaddr)) return vmaddr; - if (fault_flags & FAULT_FLAG_RETRY_NOWAIT) { + if (fault_flags & FAULT_FLAG_RETRY_NOWAIT) rc = fixup_user_fault_nowait(gmap->mm, vmaddr, fault_flags, &unlocked); - if (rc) - return rc; - } else if (fixup_user_fault(gmap->mm, vmaddr, fault_flags, &unlocked)) { - return -EFAULT; - } + else + rc = fixup_user_fault(gmap->mm, vmaddr, fault_flags, &unlocked); + if (rc) + return rc; /* * In the case that fixup_user_fault unlocked the mmap_lock during * fault-in, redo __gmap_translate() to avoid racing with a |