提交 5384a3a3 编写于 作者: M Mao Minkai 提交者: guzitao

sw64: fix __csum_and_copy when dest is not 8-byte aligned

Sunway inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I56W9F

--------------------------------

When destination is not 8-byte aligned,
csum_partial_cfu_dest_unaligned() should be used to avoid kernel
unaligned exception.

Fixes: 2fcadd2861b4 ("sw64: optimize ip checksum calculation")
Signed-off-by: NMao Minkai <maominkai@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 de13548b
...@@ -128,9 +128,9 @@ static __wsum __csum_and_copy(const void __user *src, void *dst, int len) ...@@ -128,9 +128,9 @@ static __wsum __csum_and_copy(const void __user *src, void *dst, int len)
(const unsigned long __user *) src, (const unsigned long __user *) src,
(unsigned long *) dst, len-8); (unsigned long *) dst, len-8);
} else { } else {
checksum = csum_partial_cfu_dest_aligned( checksum = csum_partial_cfu_dest_unaligned(
(const unsigned long __user *) src, (const unsigned long __user *) src,
(unsigned long *) dst, len-8); (unsigned long *) dst, doff, len-8);
} }
return (__force __wsum)from64to16(checksum); return (__force __wsum)from64to16(checksum);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册