cifs: Fix connections leak when tlink setup failed
authorZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Fri, 11 Nov 2022 07:12:12 +0000 (15:12 +0800)
committerSteve French <stfrench@microsoft.com>
Fri, 11 Nov 2022 17:59:30 +0000 (11:59 -0600)
commit1dcdf5f5b2137185cbdd5385f29949ab3da4f00c
tree37d4956e683aaec997de760aca7356056106f2cf
parentf0c4d9fc9cc9462659728d168387191387e903cc
cifs: Fix connections leak when tlink setup failed

If the tlink setup failed, lost to put the connections, then
the module refcnt leak since the cifsd kthread not exit.

Also leak the fscache info, and for next mount with fsc, it will
print the follow errors:
  CIFS: Cache volume key already in use (cifs,127.0.0.1:445,TEST)

Let's check the result of tlink setup, and do some cleanup.

Fixes: 56c762eb9bee ("cifs: Refactor out cifs_mount()")
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/connect.c