This is a note to let you know that I've just added the patch titled cifs: Fix xid leak in cifs_ses_add_channel() to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: cifs-fix-xid-leak-in-cifs_ses_add_channel.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 4641afff5d883342e12b6a0bf92eeeb48101541c Author: Zhang Xiaoxu <zhangxiaoxu5@xxxxxxxxxx> Date: Mon Oct 17 22:45:24 2022 +0800 cifs: Fix xid leak in cifs_ses_add_channel() [ Upstream commit e909d054bdea75ef1ec48c18c5936affdaecbb2c ] Before return, should free the xid, otherwise, the xid will be leaked. Fixes: d70e9fa55884 ("cifs: try opening channels after mounting") Reviewed-by: Paulo Alcantara (SUSE) <pc@xxxxxx> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@xxxxxxxxxx> Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 5500ea783784..0fbd0f78f361 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -320,6 +320,7 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses, if (rc && chan->server) cifs_put_tcp_session(chan->server, 0); + free_xid(xid); return rc; }