cifs: Fix xid leak in cifs_ses_add_channel()
authorZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Mon, 17 Oct 2022 14:45:24 +0000 (22:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 30 Oct 2022 08:41:17 +0000 (09:41 +0100)
[ 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@cjr.nz>
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/sess.c

index d58c5ffeca0d97e51ac3611a354f913524613e67..cf6fd138d8d5c8f66b25017a0e0f6fb042615ddb 100644 (file)
@@ -306,6 +306,7 @@ out:
                cifs_put_tcp_session(chan->server, 0);
        unload_nls(vol.local_nls);
 
+       free_xid(xid);
        return rc;
 }