]> git.baikalelectronics.ru Git - kernel.git/commit
iov_iter: don't revert iov buffer if csum error
authorDing Tianhong <dingtianhong@huawei.com>
Sat, 29 Apr 2017 02:38:48 +0000 (10:38 +0800)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 1 May 2017 18:49:53 +0000 (14:49 -0400)
commit4f87806585059bffeb016b584189a136cbf5ecfa
tree6fe5747d0ba55ff5d431d850e172ef1bc43b3336
parent00391dca36bd75e8f93cf69cfea4c1d69751cf7e
iov_iter: don't revert iov buffer if csum error

The patch 93f74c723d1f (make skb_copy_datagram_msg() et.al. preserve
->msg_iter on error) will revert the iov buffer if copy to iter
failed, but it didn't copy any datagram if the skb_checksum_complete
error, so no need to revert any data at this place.

v2: Sabrina notice that return -EFAULT when checksum error is not correct
    here, it would confuse the caller about the return value, so fix it.

Fixes: 93f74c723d1f ("make skb_copy_datagram_msg() et.al. preserve->msg_iter on error")
Cc: stable@vger.kernel.org # v4.11
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
net/core/datagram.c