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

[ Upstream commit 575e079c782b9862ec2626403922d041a42e6ed6 ]

If not flock, before return -ENOLCK, should free the xid,
otherwise, the xid will be leaked.

Fixes: d0677992d2af ("cifs: add support for flock")
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/file.c