Bluetooth: Remove useless flush_work() causing lockdep warnings
[safe/jmp/linux-2.6] / net / netlink / genetlink.c
index f5aa23c..1d3dd30 100644 (file)
@@ -225,6 +225,7 @@ void genl_unregister_mc_group(struct genl_family *family,
        __genl_unregister_mc_group(family, grp);
        genl_unlock();
 }
+EXPORT_SYMBOL(genl_unregister_mc_group);
 
 static void genl_unregister_mc_groups(struct genl_family *family)
 {
@@ -444,8 +445,11 @@ static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                if (ops->dumpit == NULL)
                        return -EOPNOTSUPP;
 
-               return netlink_dump_start(genl_sock, skb, nlh,
-                                         ops->dumpit, ops->done);
+               genl_unlock();
+               err = netlink_dump_start(genl_sock, skb, nlh,
+                                        ops->dumpit, ops->done);
+               genl_lock();
+               return err;
        }
 
        if (ops->doit == NULL)
@@ -603,9 +607,6 @@ static int ctrl_dumpfamily(struct sk_buff *skb, struct netlink_callback *cb)
        int chains_to_skip = cb->args[0];
        int fams_to_skip = cb->args[1];
 
-       if (chains_to_skip != 0)
-               genl_lock();
-
        for (i = 0; i < GENL_FAM_TAB_SIZE; i++) {
                if (i < chains_to_skip)
                        continue;
@@ -623,9 +624,6 @@ static int ctrl_dumpfamily(struct sk_buff *skb, struct netlink_callback *cb)
        }
 
 errout:
-       if (chains_to_skip != 0)
-               genl_unlock();
-
        cb->args[0] = i;
        cb->args[1] = n;
 
@@ -770,7 +768,7 @@ static int __init genl_init(void)
 
        /* we'll bump the group number right afterwards */
        genl_sock = netlink_kernel_create(&init_net, NETLINK_GENERIC, 0,
-                                         genl_rcv, NULL, THIS_MODULE);
+                                         genl_rcv, &genl_mutex, THIS_MODULE);
        if (genl_sock == NULL)
                panic("GENL: Cannot initialize generic netlink\n");