aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink
diff options
context:
space:
mode:
Diffstat (limited to 'net/netlink')
-rw-r--r--net/netlink/genetlink.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 43e72419c86..f329b72578f 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -13,26 +13,27 @@
13#include <linux/socket.h> 13#include <linux/socket.h>
14#include <linux/string.h> 14#include <linux/string.h>
15#include <linux/skbuff.h> 15#include <linux/skbuff.h>
16#include <linux/mutex.h>
16#include <net/sock.h> 17#include <net/sock.h>
17#include <net/genetlink.h> 18#include <net/genetlink.h>
18 19
19struct sock *genl_sock = NULL; 20struct sock *genl_sock = NULL;
20 21
21static DECLARE_MUTEX(genl_sem); /* serialization of message processing */ 22static DEFINE_MUTEX(genl_mutex); /* serialization of message processing */
22 23
23static void genl_lock(void) 24static void genl_lock(void)
24{ 25{
25 down(&genl_sem); 26 mutex_lock(&genl_mutex);
26} 27}
27 28
28static int genl_trylock(void) 29static int genl_trylock(void)
29{ 30{
30 return down_trylock(&genl_sem); 31 return !mutex_trylock(&genl_mutex);
31} 32}
32 33
33static void genl_unlock(void) 34static void genl_unlock(void)
34{ 35{
35 up(&genl_sem); 36 mutex_unlock(&genl_mutex);
36 37
37 if (genl_sock && genl_sock->sk_receive_queue.qlen) 38 if (genl_sock && genl_sock->sk_receive_queue.qlen)
38 genl_sock->sk_data_ready(genl_sock, 0); 39 genl_sock->sk_data_ready(genl_sock, 0);