mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
[NETLINK]: don't reinitialize callback mutex
Don't reinitialize the callback mutex the netlink_kernel_create caller handed in, it is supposed to already be initialized and could already be held by someone. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6313c1e099
commit
ffa4d7216e
1 changed files with 6 additions and 2 deletions
|
@ -388,8 +388,12 @@ static int __netlink_create(struct socket *sock, struct mutex *cb_mutex,
|
||||||
sock_init_data(sock, sk);
|
sock_init_data(sock, sk);
|
||||||
|
|
||||||
nlk = nlk_sk(sk);
|
nlk = nlk_sk(sk);
|
||||||
nlk->cb_mutex = cb_mutex ? : &nlk->cb_def_mutex;
|
if (cb_mutex)
|
||||||
|
nlk->cb_mutex = cb_mutex;
|
||||||
|
else {
|
||||||
|
nlk->cb_mutex = &nlk->cb_def_mutex;
|
||||||
mutex_init(nlk->cb_mutex);
|
mutex_init(nlk->cb_mutex);
|
||||||
|
}
|
||||||
init_waitqueue_head(&nlk->wait);
|
init_waitqueue_head(&nlk->wait);
|
||||||
|
|
||||||
sk->sk_destruct = netlink_sock_destruct;
|
sk->sk_destruct = netlink_sock_destruct;
|
||||||
|
|
Loading…
Reference in a new issue