aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink/af_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/netlink/af_netlink.c')
-rw-r--r--net/netlink/af_netlink.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index ec16c9b7b3bd..64d4b27f25ab 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -388,8 +388,12 @@ static int __netlink_create(struct socket *sock, struct mutex *cb_mutex,
388 sock_init_data(sock, sk); 388 sock_init_data(sock, sk);
389 389
390 nlk = nlk_sk(sk); 390 nlk = nlk_sk(sk);
391 nlk->cb_mutex = cb_mutex ? : &nlk->cb_def_mutex; 391 if (cb_mutex)
392 mutex_init(nlk->cb_mutex); 392 nlk->cb_mutex = cb_mutex;
393 else {
394 nlk->cb_mutex = &nlk->cb_def_mutex;
395 mutex_init(nlk->cb_mutex);
396 }
393 init_waitqueue_head(&nlk->wait); 397 init_waitqueue_head(&nlk->wait);
394 398
395 sk->sk_destruct = netlink_sock_destruct; 399 sk->sk_destruct = netlink_sock_destruct;