提交 9280a601 编写于 作者: J Jeff Layton

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: NJeff Layton <jlayton@redhat.com>
上级 4e897f5b
......@@ -632,9 +632,8 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
if (err)
break;
err = fixup_compat_flock(&flock);
if (err)
return err;
err = put_compat_flock(&flock, compat_ptr(arg));
if (!err)
err = put_compat_flock(&flock, compat_ptr(arg));
break;
case F_GETLK64:
case F_OFD_GETLK:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册