Delete invalid assignment statements in do_sendfile
authornixiaoming <nixiaoming@huawei.com>
Sun, 22 Jul 2018 08:37:08 +0000 (16:37 +0800)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 18 Oct 2018 05:42:49 +0000 (01:42 -0400)
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 <nixiaoming@huawei.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/read_write.c

index c734bc2..7f79b1f 100644 (file)
@@ -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;