Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9280a601 authored by Jeff Layton's avatar Jeff Layton
Browse files

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: 94073ad7 (fs/locks: don't mess with the address limit in compat_fcntl64)
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
parent 4e897f5b
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -632,8 +632,7 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
		if (err)
			break;
		err = fixup_compat_flock(&flock);
		if (err)
			return err;
		if (!err)
			err = put_compat_flock(&flock, compat_ptr(arg));
		break;
	case F_GETLK64: