From: Patrick McHardy Date: Wed, 25 Apr 2007 21:01:17 +0000 (-0700) Subject: [NETLINK]: don't reinitialize callback mutex X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ffa4d7216e848fbfdcb8e6f0bb66abeaa1888964;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: David S. Miller --- 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, sock_init_data(sock, sk); nlk = nlk_sk(sk); - nlk->cb_mutex = cb_mutex ? : &nlk->cb_def_mutex; - mutex_init(nlk->cb_mutex); + if (cb_mutex) + nlk->cb_mutex = cb_mutex; + else { + nlk->cb_mutex = &nlk->cb_def_mutex; + mutex_init(nlk->cb_mutex); + } init_waitqueue_head(&nlk->wait); sk->sk_destruct = netlink_sock_destruct;