aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/connect.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 01e280cab066..1a93604d98f6 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3756,16 +3756,13 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
3756 BCC(smb_buffer_response)) { 3756 BCC(smb_buffer_response)) {
3757 kfree(tcon->nativeFileSystem); 3757 kfree(tcon->nativeFileSystem);
3758 tcon->nativeFileSystem = 3758 tcon->nativeFileSystem =
3759 kzalloc(2*(length + 1), GFP_KERNEL); 3759 kzalloc((4 * length) + 2, GFP_KERNEL);
3760 if (tcon->nativeFileSystem) 3760 if (tcon->nativeFileSystem)
3761 cifs_strfromUCS_le( 3761 cifs_strfromUCS_le(
3762 tcon->nativeFileSystem, 3762 tcon->nativeFileSystem,
3763 (__le16 *) bcc_ptr, 3763 (__le16 *) bcc_ptr,
3764 length, nls_codepage); 3764 length, nls_codepage);
3765 bcc_ptr += 2 * length; 3765 bcc_ptr += (2 * length) + 2;
3766 bcc_ptr[0] = 0; /* null terminate the string */
3767 bcc_ptr[1] = 0;
3768 bcc_ptr += 2;
3769 } 3766 }
3770 /* else do not bother copying these information fields*/ 3767 /* else do not bother copying these information fields*/
3771 } else { 3768 } else {