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)
committerSteve French <stfrench@microsoft.com>
Tue, 18 Oct 2022 16:33:43 +0000 (11:33 -0500)
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>
fs/cifs/sess.c

index 0435d1dfa9e11fb998d140d11ea88a6fdd76f4d6..92e4278ec35d536714a440a6193c35a9721ec5eb 100644 (file)
@@ -496,6 +496,7 @@ out:
                cifs_put_tcp_session(chan->server, 0);
        }
 
+       free_xid(xid);
        return rc;
 }