diff options
author | Steve French <sfrench@us.ibm.com> | 2010-04-03 13:20:21 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-04-03 13:20:21 -0400 |
commit | a24e2d7d8f512340991ef0a59cb5d08d491b8e98 (patch) | |
tree | ceda70bdfd41835725f951d026073056f38aed42 /fs/cifs | |
parent | 810627a013163cd294762d57c0ea2ec055ffe4f6 (diff) |
[CIFS] initialize nbytes at the beginning of CIFSSMBWrite()
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.
CC: Stable <stable@kernel.org>
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>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifssmb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 7cc7f83e9314..e1f90a3a0162 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -1430,6 +1430,8 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon, | |||
1430 | __u32 bytes_sent; | 1430 | __u32 bytes_sent; |
1431 | __u16 byte_count; | 1431 | __u16 byte_count; |
1432 | 1432 | ||
1433 | *nbytes = 0; | ||
1434 | |||
1433 | /* cFYI(1, ("write at %lld %d bytes", offset, count));*/ | 1435 | /* cFYI(1, ("write at %lld %d bytes", offset, count));*/ |
1434 | if (tcon->ses == NULL) | 1436 | if (tcon->ses == NULL) |
1435 | return -ECONNABORTED; | 1437 | return -ECONNABORTED; |
@@ -1512,7 +1514,6 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon, | |||
1512 | cifs_stats_inc(&tcon->num_writes); | 1514 | cifs_stats_inc(&tcon->num_writes); |
1513 | if (rc) { | 1515 | if (rc) { |
1514 | cFYI(1, ("Send error in write = %d", rc)); | 1516 | cFYI(1, ("Send error in write = %d", rc)); |
1515 | *nbytes = 0; | ||
1516 | } else { | 1517 | } else { |
1517 | *nbytes = le16_to_cpu(pSMBr->CountHigh); | 1518 | *nbytes = le16_to_cpu(pSMBr->CountHigh); |
1518 | *nbytes = (*nbytes) << 16; | 1519 | *nbytes = (*nbytes) << 16; |