@@ -1737,10 +1737,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
/* Now build new password string */
temp_len = strlen(value);
vol->password = kzalloc(temp_len+1, GFP_KERNEL);
- if (vol->password == NULL) {
- pr_warn("CIFS: no memory for password\n");
+ if (!vol->password)
goto cifs_parse_mount_err;
- }
for (i = 0, j = 0; i < temp_len; i++, j++) {
vol->password[j] = value[i];
@@ -1780,10 +1778,9 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
kfree(vol->domainname);
vol->domainname = kstrdup(string, GFP_KERNEL);
- if (!vol->domainname) {
- pr_warn("CIFS: no memory for domainname\n");
+ if (!vol->domainname)
goto cifs_parse_mount_err;
- }
+
cifs_dbg(FYI, "Domain name set\n");
break;
case Opt_srcaddr:
@@ -1813,10 +1810,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
kfree(vol->iocharset);
vol->iocharset = kstrdup(string,
GFP_KERNEL);
- if (!vol->iocharset) {
- pr_warn("CIFS: no memory for charset\n");
+ if (!vol->iocharset)
goto cifs_parse_mount_err;
- }
}
/* if iocharset not set then load_nls_default
* is used by caller
@@ -2494,8 +2489,6 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses)
vol->username = kstrndup(payload, len, GFP_KERNEL);
if (!vol->username) {
- cifs_dbg(FYI, "Unable to allocate %zd bytes for username\n",
- len);
rc = -ENOMEM;
goto out_key_put;
}
@@ -2513,8 +2506,6 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses)
++delim;
vol->password = kstrndup(delim, len, GFP_KERNEL);
if (!vol->password) {
- cifs_dbg(FYI, "Unable to allocate %zd bytes for password\n",
- len);
rc = -ENOMEM;
kfree(vol->username);
vol->username = NULL;
@@ -317,10 +317,9 @@ int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len,
if (tilen) {
ses->auth_key.response = kmemdup(bcc_ptr + tioffset, tilen,
GFP_KERNEL);
- if (!ses->auth_key.response) {
- cifs_dbg(VFS, "Challenge target info alloc failure");
+ if (!ses->auth_key.response)
return -ENOMEM;
- }
+
ses->auth_key.len = tilen;
}
@@ -1048,8 +1047,6 @@ sess_auth_kerberos(struct sess_data *sess_data)
ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len,
GFP_KERNEL);
if (!ses->auth_key.response) {
- cifs_dbg(VFS, "Kerberos can't allocate (%u bytes) memory",
- msg->sesskey_len);
rc = -ENOMEM;
goto out_put_spnego_key;
}
@@ -1988,7 +1988,6 @@ crypt_message(struct TCP_Server_Info *server, struct smb_rqst *rqst, int enc)
iv_len = crypto_aead_ivsize(tfm);
iv = kzalloc(iv_len, GFP_KERNEL);
if (!iv) {
- cifs_dbg(VFS, "%s: Failed to alloc IV", __func__);
rc = -ENOMEM;
goto free_sg;
}
@@ -851,9 +851,6 @@ SMB2_auth_kerberos(struct SMB2_sess_data *sess_data)
ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len,
GFP_KERNEL);
if (!ses->auth_key.response) {
- cifs_dbg(VFS,
- "Kerberos can't allocate (%u bytes) memory",
- msg->sesskey_len);
rc = -ENOMEM;
goto out_put_spnego_key;
}
@@ -2122,9 +2119,6 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon,
if (!*data) {
*data = kmalloc(*dlen, GFP_KERNEL);
if (!*data) {
- cifs_dbg(VFS,
- "Error %d allocating memory for acl\n",
- rc);
*dlen = 0;
goto qinf_exit;
}
@@ -100,7 +100,6 @@ smb3_crypto_shash_allocate(struct TCP_Server_Info *server)
crypto_shash_descsize(server->secmech.cmacaes);
server->secmech.sdesccmacaes = kmalloc(size, GFP_KERNEL);
if (!server->secmech.sdesccmacaes) {
- cifs_dbg(VFS, "%s: Can't alloc cmacaes\n", __func__);
kfree(server->secmech.sdeschmacsha256);
server->secmech.sdeschmacsha256 = NULL;
crypto_free_shash(server->secmech.hmacsha256);