Skip to content

Commit c71f8fb

Browse files
committed
Merge tag 'v6.12-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull smb client fixes from Steve French: - Fix init module error caseb - Fix memory allocation error path (for passwords) in mount * tag 'v6.12-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix warning when destroy 'cifs_io_request_pool' smb: client: Handle kstrdup failures for passwords
2 parents 81dcc79 + 2ce1007 commit c71f8fb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

fs/smb/client/cifsfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1780,7 +1780,7 @@ static int cifs_init_netfs(void)
17801780
nomem_subreqpool:
17811781
kmem_cache_destroy(cifs_io_subrequest_cachep);
17821782
nomem_subreq:
1783-
mempool_destroy(&cifs_io_request_pool);
1783+
mempool_exit(&cifs_io_request_pool);
17841784
nomem_reqpool:
17851785
kmem_cache_destroy(cifs_io_request_cachep);
17861786
nomem_req:

fs/smb/client/fs_context.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,8 +920,15 @@ static int smb3_reconfigure(struct fs_context *fc)
920920
else {
921921
kfree_sensitive(ses->password);
922922
ses->password = kstrdup(ctx->password, GFP_KERNEL);
923+
if (!ses->password)
924+
return -ENOMEM;
923925
kfree_sensitive(ses->password2);
924926
ses->password2 = kstrdup(ctx->password2, GFP_KERNEL);
927+
if (!ses->password2) {
928+
kfree_sensitive(ses->password);
929+
ses->password = NULL;
930+
return -ENOMEM;
931+
}
925932
}
926933
STEAL_STRING(cifs_sb, ctx, domainname);
927934
STEAL_STRING(cifs_sb, ctx, nodename);

0 commit comments

Comments
 (0)