@@ -1512,7 +1512,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;
@@ -1539,8 +1538,6 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon,
int smb_hdr_len;
int resp_buf_type = 0;
- *nbytes = 0;
-
cFYI(1, ("write2 at %lld %d bytes", (long long)offset, count));
if (tcon->ses->capabilities & CAP_LARGE_FILES) {
@@ -560,7 +560,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
/* BB Do not bother to decode buf since no
local inode yet to put timestamps in,
but we can reuse it safely */
- unsigned int bytes_written;
+ unsigned int bytes_written = 0;
struct win_dev *pdev;
pdev = (struct win_dev *)buf;
if (S_ISCHR(mode)) {
@@ -1341,7 +1341,7 @@ static int cifs_writepages(struct address_space *mapping,
{
struct backing_dev_info *bdi = mapping->backing_dev_info;
unsigned int bytes_to_write;
- unsigned int bytes_written;
+ unsigned int bytes_written = 0;
struct cifs_sb_info *cifs_sb;
int done = 0;
pgoff_t end;
@@ -1674,7 +1674,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
cifsFileInfo_put(open_file);
cFYI(1, ("SetFSize for attrs rc = %d", rc));
if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
- unsigned int bytes_written;
+ unsigned int bytes_written = 0;
rc = CIFSSMBWrite(xid, pTcon, nfid, 0, attrs->ia_size,
&bytes_written, NULL, NULL, 1);
cFYI(1, ("Wrt seteof rc %d", rc));
@@ -1703,7 +1703,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc == 0) {
- unsigned int bytes_written;
+ unsigned int bytes_written = 0;
rc = CIFSSMBWrite(xid, pTcon, netfid, 0,
attrs->ia_size,
&bytes_written, NULL,