Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4638893imm; Sun, 22 Jul 2018 02:12:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeVsp7Q3585sMD6lCyb6zZGxQUEqYMG4o+K7Bdtk8Y9oBbF0toT+VJezta4+MHRDIlmoRaq X-Received: by 2002:a17:902:8207:: with SMTP id x7-v6mr8374562pln.57.1532250773511; Sun, 22 Jul 2018 02:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532250773; cv=none; d=google.com; s=arc-20160816; b=UfAifp1geHv5eeUX3B5KAMaAc6mEM44iiRX5v07i40GsaFoX5Q0doF5dv6mjVoubEg B/IenaOW7PvboRV4f3sMABrX1p6rtq1Q7sxNv2ycprkVE0dFxMFEEPxtw8+9R5GC5bt/ DR4pyOtoynYpj/7Ce/2+HbdX2wl0D3mLIW4wJ9lgc7/TgnBiKJkcaVkavGjNCLJ4AwFw zjpWL4miKC/ogCV4Wt0TjjR41wXVZ2bLfpBA7kvlxABrW1npxupv7H+D7FqhNpFGpgMI k6X4/fnGHdBR7glxZ4gv060TlpZ/fQ4+YoQ3nvTKPqFOLRNSeAfnDBpzlEHrRkw0owx0 Ji6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=flZaLLPKjqmQAdVL3X/WSCebCvs9MDS7DfqhTIZRi8c=; b=CnW4FS9lWFntuFH720bxGjx749ASfi1lqwx66EAY8LD31bleq7GRWbmNUuQqV/QLin oaSvdSNCcogoKQrx1ulX2bKpSI4SkfkYc3eP5W/GTNEL4JIVfhqjb/CkTGss/vYAR5UI 0eSUQ2IXGcIBov41Dw2CFqBGe4C/RMdo9WMhcU8LKeq5KUiSx0uaf3KV7iZeWUrVeVqC 03l+MZk0JCMuscFIJ8DsNYo0a0F45t25PKhd9l4Mqf6Kz93imx2HmtjR3OZe9oLNYZkf t9KkbsLv2ZZ0dgZhKuWH5l1KotC87ELuPYo4tBLNs1h8oaEeYe8eEfTFOj+dM8KB2DCb RlLQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5-v6si6273198pgb.399.2018.07.22.02.12.37; Sun, 22 Jul 2018 02:12:53 -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 S1728270AbeGVKHt (ORCPT + 99 others); Sun, 22 Jul 2018 06:07:49 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:50939 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728053AbeGVKHt (ORCPT ); Sun, 22 Jul 2018 06:07:49 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 45C9BD0EB11DE; Sun, 22 Jul 2018 17:11:37 +0800 (CST) Received: from linux-work.huawei.com (10.67.189.174) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.382.0; Sun, 22 Jul 2018 17:11:28 +0800 From: nixiaoming To: CC: , , Subject: [PATCH] Delete invalid assignment statements in do_sendfile Date: Sun, 22 Jul 2018 16:37:08 +0800 Message-ID: <20180722083708.46865-1-nixiaoming@huawei.com> X-Mailer: git-send-email 2.10.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.189.174] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Assigning value -EINVAL to "retval" here, but that stored value is overwritten before it can be used. retval = -EINVAL; .... retval = rw_verify_area(WRITE, out.file, &out_pos, count); value_overwrite: Overwriting previous write to "retval" with value from rw_verify_area delete invalid assignment statements Signed-off-by: n00202754 --- fs/read_write.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/read_write.c b/fs/read_write.c index 153f8f6..9ab202c 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -1407,7 +1407,6 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, goto fput_in; if (!(out.file->f_mode & FMODE_WRITE)) goto fput_out; - retval = -EINVAL; in_inode = file_inode(in.file); out_inode = file_inode(out.file); out_pos = out.file->f_pos; -- 2.10.1