diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index d3aa999ab785..f3bfe08e177b 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -773,8 +773,7 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server) | |||
773 | 773 | ||
774 | length = atomic_dec_return(&tcpSesAllocCount); | 774 | length = atomic_dec_return(&tcpSesAllocCount); |
775 | if (length > 0) | 775 | if (length > 0) |
776 | mempool_resize(cifs_req_poolp, length + cifs_min_rcv, | 776 | mempool_resize(cifs_req_poolp, length + cifs_min_rcv); |
777 | GFP_KERNEL); | ||
778 | } | 777 | } |
779 | 778 | ||
780 | static int | 779 | static int |
@@ -848,8 +847,7 @@ cifs_demultiplex_thread(void *p) | |||
848 | 847 | ||
849 | length = atomic_inc_return(&tcpSesAllocCount); | 848 | length = atomic_inc_return(&tcpSesAllocCount); |
850 | if (length > 1) | 849 | if (length > 1) |
851 | mempool_resize(cifs_req_poolp, length + cifs_min_rcv, | 850 | mempool_resize(cifs_req_poolp, length + cifs_min_rcv); |
852 | GFP_KERNEL); | ||
853 | 851 | ||
854 | set_freezable(); | 852 | set_freezable(); |
855 | while (server->tcpStatus != CifsExiting) { | 853 | while (server->tcpStatus != CifsExiting) { |
@@ -1599,6 +1597,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1599 | pr_warn("CIFS: username too long\n"); | 1597 | pr_warn("CIFS: username too long\n"); |
1600 | goto cifs_parse_mount_err; | 1598 | goto cifs_parse_mount_err; |
1601 | } | 1599 | } |
1600 | |||
1601 | kfree(vol->username); | ||
1602 | vol->username = kstrdup(string, GFP_KERNEL); | 1602 | vol->username = kstrdup(string, GFP_KERNEL); |
1603 | if (!vol->username) | 1603 | if (!vol->username) |
1604 | goto cifs_parse_mount_err; | 1604 | goto cifs_parse_mount_err; |
@@ -1700,6 +1700,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1700 | goto cifs_parse_mount_err; | 1700 | goto cifs_parse_mount_err; |
1701 | } | 1701 | } |
1702 | 1702 | ||
1703 | kfree(vol->domainname); | ||
1703 | vol->domainname = kstrdup(string, GFP_KERNEL); | 1704 | vol->domainname = kstrdup(string, GFP_KERNEL); |
1704 | if (!vol->domainname) { | 1705 | if (!vol->domainname) { |
1705 | pr_warn("CIFS: no memory for domainname\n"); | 1706 | pr_warn("CIFS: no memory for domainname\n"); |
@@ -1731,6 +1732,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1731 | } | 1732 | } |
1732 | 1733 | ||
1733 | if (strncasecmp(string, "default", 7) != 0) { | 1734 | if (strncasecmp(string, "default", 7) != 0) { |
1735 | kfree(vol->iocharset); | ||
1734 | vol->iocharset = kstrdup(string, | 1736 | vol->iocharset = kstrdup(string, |
1735 | GFP_KERNEL); | 1737 | GFP_KERNEL); |
1736 | if (!vol->iocharset) { | 1738 | if (!vol->iocharset) { |
@@ -2913,8 +2915,7 @@ ip_rfc1001_connect(struct TCP_Server_Info *server) | |||
2913 | * calling name ends in null (byte 16) from old smb | 2915 | * calling name ends in null (byte 16) from old smb |
2914 | * convention. | 2916 | * convention. |
2915 | */ | 2917 | */ |
2916 | if (server->workstation_RFC1001_name && | 2918 | if (server->workstation_RFC1001_name[0] != 0) |
2917 | server->workstation_RFC1001_name[0] != 0) | ||
2918 | rfc1002mangle(ses_init_buf->trailer. | 2919 | rfc1002mangle(ses_init_buf->trailer. |
2919 | session_req.calling_name, | 2920 | session_req.calling_name, |
2920 | server->workstation_RFC1001_name, | 2921 | server->workstation_RFC1001_name, |
@@ -3692,6 +3693,12 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses, | |||
3692 | #endif /* CIFS_WEAK_PW_HASH */ | 3693 | #endif /* CIFS_WEAK_PW_HASH */ |
3693 | rc = SMBNTencrypt(tcon->password, ses->server->cryptkey, | 3694 | rc = SMBNTencrypt(tcon->password, ses->server->cryptkey, |
3694 | bcc_ptr, nls_codepage); | 3695 | bcc_ptr, nls_codepage); |
3696 | if (rc) { | ||
3697 | cifs_dbg(FYI, "%s Can't generate NTLM rsp. Error: %d\n", | ||
3698 | __func__, rc); | ||
3699 | cifs_buf_release(smb_buffer); | ||
3700 | return rc; | ||
3701 | } | ||
3695 | 3702 | ||
3696 | bcc_ptr += CIFS_AUTH_RESP_SIZE; | 3703 | bcc_ptr += CIFS_AUTH_RESP_SIZE; |
3697 | if (ses->capabilities & CAP_UNICODE) { | 3704 | if (ses->capabilities & CAP_UNICODE) { |