]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
cif: fix dead code
authorMichael Opdenacker <michael.opdenacker@free-electrons.com>
Tue, 15 Apr 2014 08:06:50 +0000 (10:06 +0200)
committerSteve French <smfrench@gmail.com>
Thu, 17 Apr 2014 04:08:57 +0000 (23:08 -0500)
This issue was found by Coverity (CID 1202536)

This proposes a fix for a statement that creates dead code.
The "rc < 0" statement is within code that is run
with "rc > 0".

It seems like "err < 0" was meant to be used here.
This way, the error code is returned by the function.

Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/file.c

index a875eedfd928e7d33016f03f1aac0db83087fe7d..5ed03e0b8b40e28b10aa46630d973b47e229c194 100644 (file)
@@ -2599,7 +2599,7 @@ cifs_writev(struct kiocb *iocb, const struct iovec *iov,
                        ssize_t err;
 
                        err = generic_write_sync(file, iocb->ki_pos - rc, rc);
-                       if (rc < 0)
+                       if (err < 0)
                                rc = err;
                }
        } else {