* [PATCH] cif: fix dead code
@ 2014-04-15 8:06 Michael Opdenacker
[not found] ` <1397549210-29445-1-git-send-email-michael.opdenacker-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Michael Opdenacker @ 2014-04-15 8:06 UTC (permalink / raw)
To: sfrench-eUNUBHrolfbYtjvyW6yDsg, linux-cifs-u79uwXL29TY76Z2rM5mHXA,
viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn
Cc: geert-Td1EMuHUCqxL1ZNQvxDV9g,
samba-technical-w/Ol4Ecudpl8XjKLYN78aQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Michael Opdenacker
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-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
fs/cifs/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 8add25538a3b..b6e78632fa97 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -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 {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <1397549210-29445-1-git-send-email-michael.opdenacker-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>]
* Re: [PATCH] cif: fix dead code [not found] ` <1397549210-29445-1-git-send-email-michael.opdenacker-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> @ 2014-04-15 8:16 ` Al Viro 2014-04-17 4:10 ` Steve French 1 sibling, 0 replies; 3+ messages in thread From: Al Viro @ 2014-04-15 8:16 UTC (permalink / raw) To: Michael Opdenacker Cc: sfrench-eUNUBHrolfbYtjvyW6yDsg, linux-cifs-u79uwXL29TY76Z2rM5mHXA, geert-Td1EMuHUCqxL1ZNQvxDV9g, samba-technical-w/Ol4Ecudpl8XjKLYN78aQ, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Tue, Apr 15, 2014 at 10:06:50AM +0200, Michael Opdenacker wrote: > 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. Acked-by: Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org> ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cif: fix dead code [not found] ` <1397549210-29445-1-git-send-email-michael.opdenacker-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> 2014-04-15 8:16 ` Al Viro @ 2014-04-17 4:10 ` Steve French 1 sibling, 0 replies; 3+ messages in thread From: Steve French @ 2014-04-17 4:10 UTC (permalink / raw) To: Michael Opdenacker Cc: Steve French, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Al Viro, Geert Uytterhoeven, samba-technical, LKML merged into cifs-2.6.git On Tue, Apr 15, 2014 at 3:06 AM, Michael Opdenacker <michael.opdenacker-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote: > 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-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> > --- > fs/cifs/file.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/cifs/file.c b/fs/cifs/file.c > index 8add25538a3b..b6e78632fa97 100644 > --- a/fs/cifs/file.c > +++ b/fs/cifs/file.c > @@ -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 { > -- > 1.8.3.2 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-cifs" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Thanks, Steve ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-17 4:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-15 8:06 [PATCH] cif: fix dead code Michael Opdenacker
[not found] ` <1397549210-29445-1-git-send-email-michael.opdenacker-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-04-15 8:16 ` Al Viro
2014-04-17 4:10 ` Steve French
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox