mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
s390/checksum: Fix csum_partial() without vector facility
Currently csum_partial() calls csum_copy() with copy=false and dst=NULL.
On machines without the vector facility, csum_copy() falls back to
cksm(dst, ...), causing the checksum to be calculated from address zero
instead of the source buffer.
The VX implementation already checksums data loaded from src. Make the
fallback do the same by passing src to cksm().
Fixes: dcd3e1de9d ("s390/checksum: provide csum_partial_copy_nocheck()")
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
parent
7d5c2f6791
commit
4bb06b60d9
|
|
@ -23,7 +23,7 @@ static __always_inline __wsum csum_copy(void *dst, const void *src, int len, __w
|
|||
if (!cpu_has_vx()) {
|
||||
if (copy)
|
||||
memcpy(dst, src, len);
|
||||
return cksm(dst, len, sum);
|
||||
return cksm(src, len, sum);
|
||||
}
|
||||
kernel_fpu_begin(&vxstate, KERNEL_VXR_V16V23);
|
||||
fpu_vlvgf(16, (__force u32)sum, 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user