summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2010-04-03 17:20:21 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-26 07:47:51 -0700
commit328f7088efe2d95b00fe277c51896062aa82942e (patch)
tree3b454d0fd6e8aa780287f924b73ff6330798f649 /fs
parentc171476c7ddde592eafb085d8a5d95ce4f1b3ef2 (diff)
downloadkernel-crypto-328f7088efe2d95b00fe277c51896062aa82942e.tar.gz
kernel-crypto-328f7088efe2d95b00fe277c51896062aa82942e.tar.xz
kernel-crypto-328f7088efe2d95b00fe277c51896062aa82942e.zip
CIFS: initialize nbytes at the beginning of CIFSSMBWrite()
commit a24e2d7d8f512340991ef0a59cb5d08d491b8e98 upstream. By doing this we always overwrite nbytes value that is being passed on to CIFSSMBWrite() and need not rely on the callers to initialize. CIFSSMBWrite2 is doing this already. Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Reviewed-by: Jeff Layton <jlayton@samba.org> Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/cifssmb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 00a4dbbdfb9..4e6dbab8443 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1430,6 +1430,8 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon,
__u32 bytes_sent;
__u16 byte_count;
+ *nbytes = 0;
+
/* cFYI(1, ("write at %lld %d bytes", offset, count));*/
if (tcon->ses == NULL)
return -ECONNABORTED;
@@ -1512,7 +1514,6 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon,
cifs_stats_inc(&tcon->num_writes);
if (rc) {
cFYI(1, ("Send error in write = %d", rc));
- *nbytes = 0;
} else {
*nbytes = le16_to_cpu(pSMBr->CountHigh);
*nbytes = (*nbytes) << 16;