cifs: Fix xid leak in cifs_copy_file_range()
authorZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Mon, 17 Oct 2022 14:45:22 +0000 (22:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Oct 2022 08:12:56 +0000 (10:12 +0200)
commit27cfd3afaab000a455194338db3b7f2031fde9d0
treea44a6b70decbc8fb6db47f2082e2dc0f735079c5
parent593d877c39aa9f3fe1a4b5b022492886d7d700ec
cifs: Fix xid leak in cifs_copy_file_range()

[ Upstream commit 9a97df404a402fe1174d2d1119f87ff2a0ca2fe9 ]

If the file is used by swap, before return -EOPNOTSUPP, should
free the xid, otherwise, the xid will be leaked.

Fixes: 4e8aea30f775 ("smb3: enable swap on SMB3 mounts")
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/cifsfs.c