fcntl: don't leak fd reference when fixup_compat_flock fails
authorJeff Layton <jlayton@redhat.com>
Tue, 14 Nov 2017 19:43:56 +0000 (14:43 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Dec 2017 08:53:11 +0000 (09:53 +0100)
commit6e9c2a05c368a0b53d5b6647798e67830f5508e0
tree3ef906dde16d8dc4024b9ce8c6263c66cd0a5026
parent0c7e787bfc91cb374b60ba5fe7055178c94a7cb7
fcntl: don't leak fd reference when fixup_compat_flock fails

[ Upstream commit 9280a601e6080c9ff658468c1c775ff6514099a6 ]

Currently we just return err here, but we need to put the fd reference
first.

Fixes: 94073ad77fff (fs/locks: don't mess with the address limit in compat_fcntl64)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/fcntl.c