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

Commit ffa4d721 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[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: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6313c1e0
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -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;