Commit fd549bfe authored by Zhang Xiaoxu's avatar Zhang Xiaoxu Committed by Lipeng Sang
Browse files

cifs: Fix xid leak in cifs_ses_add_channel()

stable inclusion
from stable-v5.10.152
commit 7286f875510486fdc2fc426b7c826262e2283a65
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I73HJ0

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7286f875510486fdc2fc426b7c826262e2283a65



--------------------------------

[ Upstream commit e909d054 ]

Before return, should free the xid, otherwise, the
xid will be leaked.

Fixes: d70e9fa5 ("cifs: try opening channels after mounting")
Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: default avatarZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarLipeng Sang <sanglipeng1@jd.com>
parent ef53451e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -306,6 +306,7 @@ cifs_ses_add_channel(struct cifs_ses *ses, struct cifs_server_iface *iface)
		cifs_put_tcp_session(chan->server, 0);
	unload_nls(vol.local_nls);

	free_xid(xid);
	return rc;
}