mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
net/handshake: Fix handshake_dup() ref counting
If get_unused_fd_flags() fails, we ended up calling fput(sock->file)
twice.
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Fixes: 3b3009ea8a
("net/handshake: Create a NETLINK service for handling handshake requests")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
a095326e2c
commit
7ea9c1ec66
@ -139,15 +139,16 @@ int handshake_nl_accept_doit(struct sk_buff *skb, struct genl_info *info)
|
||||
goto out_complete;
|
||||
}
|
||||
err = req->hr_proto->hp_accept(req, info, fd);
|
||||
if (err)
|
||||
if (err) {
|
||||
fput(sock->file);
|
||||
goto out_complete;
|
||||
}
|
||||
|
||||
trace_handshake_cmd_accept(net, req, req->hr_sk, fd);
|
||||
return 0;
|
||||
|
||||
out_complete:
|
||||
handshake_complete(req, -EIO, NULL);
|
||||
fput(sock->file);
|
||||
out_status:
|
||||
trace_handshake_cmd_accept_err(net, req, NULL, err);
|
||||
return err;
|
||||
|
Loading…
Reference in New Issue
Block a user