diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 446e2486d5f0..18af707f00f1 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -1707,6 +1707,7 @@ cifs_put_smb_ses(struct cifsSesInfo *ses) | |||
1707 | CIFSSMBLogoff(xid, ses); | 1707 | CIFSSMBLogoff(xid, ses); |
1708 | _FreeXid(xid); | 1708 | _FreeXid(xid); |
1709 | } | 1709 | } |
1710 | cifs_crypto_shash_release(server); | ||
1710 | sesInfoFree(ses); | 1711 | sesInfoFree(ses); |
1711 | cifs_put_tcp_session(server); | 1712 | cifs_put_tcp_session(server); |
1712 | } | 1713 | } |
@@ -1786,13 +1787,23 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) | |||
1786 | ses->linux_uid = volume_info->linux_uid; | 1787 | ses->linux_uid = volume_info->linux_uid; |
1787 | ses->overrideSecFlg = volume_info->secFlg; | 1788 | ses->overrideSecFlg = volume_info->secFlg; |
1788 | 1789 | ||
1790 | rc = cifs_crypto_shash_allocate(server); | ||
1791 | if (rc) { | ||
1792 | cERROR(1, "could not setup hash structures rc %d", rc); | ||
1793 | goto get_ses_fail; | ||
1794 | } | ||
1795 | server->tilen = 0; | ||
1796 | server->tiblob = NULL; | ||
1797 | |||
1789 | mutex_lock(&ses->session_mutex); | 1798 | mutex_lock(&ses->session_mutex); |
1790 | rc = cifs_negotiate_protocol(xid, ses); | 1799 | rc = cifs_negotiate_protocol(xid, ses); |
1791 | if (!rc) | 1800 | if (!rc) |
1792 | rc = cifs_setup_session(xid, ses, volume_info->local_nls); | 1801 | rc = cifs_setup_session(xid, ses, volume_info->local_nls); |
1793 | mutex_unlock(&ses->session_mutex); | 1802 | mutex_unlock(&ses->session_mutex); |
1794 | if (rc) | 1803 | if (rc) { |
1804 | cifs_crypto_shash_release(ses->server); | ||
1795 | goto get_ses_fail; | 1805 | goto get_ses_fail; |
1806 | } | ||
1796 | 1807 | ||
1797 | /* success, put it on the list */ | 1808 | /* success, put it on the list */ |
1798 | write_lock(&cifs_tcp_ses_lock); | 1809 | write_lock(&cifs_tcp_ses_lock); |