1
0
Fork 0

fcntl: don't leak fd reference when fixup_compat_flock fails

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

Fixes: 94073ad77f (fs/locks: don't mess with the address limit in compat_fcntl64)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
hifive-unleashed-5.1
Jeff Layton 2017-11-14 14:43:56 -05:00
parent 4e897f5bb9
commit 9280a601e6
1 changed files with 2 additions and 3 deletions

View File

@ -632,9 +632,8 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
if (err) if (err)
break; break;
err = fixup_compat_flock(&flock); err = fixup_compat_flock(&flock);
if (err) if (!err)
return err; err = put_compat_flock(&flock, compat_ptr(arg));
err = put_compat_flock(&flock, compat_ptr(arg));
break; break;
case F_GETLK64: case F_GETLK64:
case F_OFD_GETLK: case F_OFD_GETLK: