From patchwork Fri Apr 28 12:48:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ding Tianhong X-Patchwork-Id: 98363 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp247092qgf; Fri, 28 Apr 2017 05:49:48 -0700 (PDT) X-Received: by 10.99.176.69 with SMTP id z5mr11952053pgo.126.1493383788418; Fri, 28 Apr 2017 05:49:48 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g87si6011646pfj.188.2017.04.28.05.49.48; Fri, 28 Apr 2017 05:49:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425843AbdD1Mth (ORCPT + 25 others); 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 Received: from 172.30.72.57 (EHLO DGGEML404-HUB.china.huawei.com) ([172.30.72.57]) by dggrg02-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AMO77465; Fri, 28 Apr 2017 20:49:11 +0800 (CST) Received: from [127.0.0.1] (10.177.23.32) by DGGEML404-HUB.china.huawei.com (10.3.17.39) with Microsoft SMTP Server id 14.3.301.0; Fri, 28 Apr 2017 20:49:52 +0800 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.8.3.1 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 {