mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
make sock_alloc_file() do sock_release() on failures
This changes calling conventions (and simplifies the hell out the callers). New rules: once struct socket had been passed to sock_alloc_file(), it's been consumed either by struct file or by sock_release() done by sock_alloc_file(). Either way the caller should not do sock_release() after that point. Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: Al Viro <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
016a266bdf
commit
8e1611e235
5 changed files with 11 additions and 31 deletions
|
|
@ -839,7 +839,6 @@ static int p9_socket_open(struct p9_client *client, struct socket *csocket)
|
|||
if (IS_ERR(file)) {
|
||||
pr_err("%s (%d): failed to map fd\n",
|
||||
__func__, task_pid_nr(current));
|
||||
sock_release(csocket);
|
||||
kfree(p);
|
||||
return PTR_ERR(file);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue