Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425843AbdD1Mth (ORCPT ); Fri, 28 Apr 2017 08:49:37 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:5837 "EHLO dggrg02-dlp.huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1035939AbdD1Mt3 (ORCPT ); Fri, 28 Apr 2017 08:49:29 -0400 To: David Miller , , , , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , LinuxArm From: Ding Tianhong Subject: [PATCH] iov_iter: don't revert if csum error Message-ID: <080dafec-c57f-0546-4d2f-ce4a31222e25@huawei.com> Date: Fri, 28 Apr 2017 20:48:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.23.32] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090206.59033A47.006F,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 0b400bd22fa8197e08f2110824bdfd27 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 829 Lines: 25 The patch 3278682 (make skb_copy_datagram_msg() et.al. preserve ->msg_iter on error) will revert the iov buffer if copy to iter failed, but it looks no need to revert for csum error, so fix it. Fixes: 3278682 ("make skb_copy_datagram_msg() et.al. preserve->msg_iter on error") Signed-off-by: Ding Tianhong --- net/core/datagram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/datagram.c b/net/core/datagram.c index f4947e7..475a8e9 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -760,7 +760,7 @@ int skb_copy_and_csum_datagram_msg(struct sk_buff *skb, if (msg_data_left(msg) < chunk) { if (__skb_checksum_complete(skb)) - goto csum_error; + goto fault; if (skb_copy_datagram_msg(skb, hlen, msg, chunk)) goto fault; } else { -- 1.8.3.1