Skip to content

Commit 9418333

Browse files
Shu Wangsmfrench
authored andcommitted
cifs: release cifs root_cred after exit_cifs
memory leak was found by kmemleak. exit_cifs_spnego should be called before cifs module removed, or cifs root_cred will not be released. kmemleak report: unreferenced object 0xffff880070a3ce40 (size 192): backtrace: kmemleak_alloc+0x4a/0xa0 kmem_cache_alloc+0xc7/0x1d0 prepare_kernel_cred+0x20/0x120 init_cifs_spnego+0x2d/0x170 [cifs] 0xffffffffc07801f3 do_one_initcall+0x51/0x1b0 do_init_module+0x60/0x1fd load_module+0x161e/0x1b60 SYSC_finit_module+0xa9/0x100 SyS_finit_module+0xe/0x10 Signed-off-by: Shu Wang <[email protected]> Signed-off-by: Steve French <[email protected]> Reviewed-by: Ronnie Sahlberg <[email protected]> CC: Stable <[email protected]>
1 parent 4d61eda commit 9418333

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cifs/cifsfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ exit_cifs(void)
14491449
exit_cifs_idmap();
14501450
#endif
14511451
#ifdef CONFIG_CIFS_UPCALL
1452-
unregister_key_type(&cifs_spnego_key_type);
1452+
exit_cifs_spnego();
14531453
#endif
14541454
cifs_destroy_request_bufs();
14551455
cifs_destroy_mids();

0 commit comments

Comments
 (0)