summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2022-06-09 21:32:39 +0200
committerAlexander Gordeev <agordeev@linux.ibm.com>2022-06-23 17:23:30 +0200
commitaf2debd58bd769e38f538143f0d332e15d753396 (patch)
tree78518674a432339bfa0255c862e662bb9fa52467 /arch
parentcc02e6e21aa5f2ac0defe8c15e5a9d024da6e73d (diff)
downloadlinux-rpi-af2debd58bd769e38f538143f0d332e15d753396.tar.gz
linux-rpi-af2debd58bd769e38f538143f0d332e15d753396.tar.bz2
linux-rpi-af2debd58bd769e38f538143f0d332e15d753396.zip
s390/crash: make copy_oldmem_page() return number of bytes copied
Callback copy_oldmem_page() returns either error code or zero. Instead, it should return the error code or number of bytes copied. Fixes: df9694c7975f ("s390/dump: streamline oldmem copy functions") Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com> Tested-by: Alexander Egorenkov <egorenar@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/kernel/crash_dump.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c
index 2534a31d2550..28124d0fa1d5 100644
--- a/arch/s390/kernel/crash_dump.c
+++ b/arch/s390/kernel/crash_dump.c
@@ -233,9 +233,10 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn, size_t csize,
rc = copy_oldmem_user(iter->iov->iov_base, src, csize);
else
rc = copy_oldmem_kernel(iter->kvec->iov_base, src, csize);
- if (!rc)
- iov_iter_advance(iter, csize);
- return rc;
+ if (rc < 0)
+ return rc;
+ iov_iter_advance(iter, csize);
+ return csize;
}
/*