[PATCH] kzalloc() conversion in arch/ppc
[linux-3.10.git] / net / netlink / genetlink.c
index 3b1378498d50b12647f2ea433a341b16502e1ac9..43e72419c868b38d660fef2a89519bd9898f2a64 100644 (file)
@@ -222,11 +222,6 @@ int genl_register_family(struct genl_family *family)
                goto errout_locked;
        }
 
-       if (!try_module_get(family->owner)) {
-               err = -EBUSY;
-               goto errout_locked;
-       }
-
        if (family->id == GENL_ID_GENERATE) {
                u16 newid = genl_generate_id();
 
@@ -243,7 +238,7 @@ int genl_register_family(struct genl_family *family)
                                        sizeof(struct nlattr *), GFP_KERNEL);
                if (family->attrbuf == NULL) {
                        err = -ENOMEM;
-                       goto errout;
+                       goto errout_locked;
                }
        } else
                family->attrbuf = NULL;
@@ -283,7 +278,6 @@ int genl_unregister_family(struct genl_family *family)
                INIT_LIST_HEAD(&family->ops_list);
                genl_unlock();
 
-               module_put(family->owner);
                kfree(family->attrbuf);
                genl_ctrl_event(CTRL_CMD_DELFAMILY, family);
                return 0;
@@ -294,7 +288,7 @@ int genl_unregister_family(struct genl_family *family)
        return -ENOENT;
 }
 
-static inline int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
+static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
                               int *errp)
 {
        struct genl_ops *ops;
@@ -381,7 +375,7 @@ static void genl_rcv(struct sock *sk, int len)
        do {
                if (genl_trylock())
                        return;
-               netlink_run_queue(sk, &qlen, &genl_rcv_msg);
+               netlink_run_queue(sk, &qlen, genl_rcv_msg);
                genl_unlock();
        } while (qlen && genl_sock && genl_sock->sk_receive_queue.qlen);
 }
@@ -535,7 +529,6 @@ static struct genl_family genl_ctrl = {
        .name = "nlctrl",
        .version = 0x1,
        .maxattr = CTRL_ATTR_MAX,
-       .owner = THIS_MODULE,
 };
 
 static int __init genl_init(void)
@@ -556,10 +549,8 @@ static int __init genl_init(void)
        netlink_set_nonroot(NETLINK_GENERIC, NL_NONROOT_RECV);
        genl_sock = netlink_kernel_create(NETLINK_GENERIC, GENL_MAX_ID,
                                          genl_rcv, THIS_MODULE);
-       if (genl_sock == NULL) {
+       if (genl_sock == NULL)
                panic("GENL: Cannot initialize generic netlink\n");
-               return -ENOMEM;
-       }
 
        return 0;
 
@@ -567,7 +558,6 @@ errout_register:
        genl_unregister_family(&genl_ctrl);
 errout:
        panic("GENL: Cannot register controller: %d\n", err);
-       return err;
 }
 
 subsys_initcall(genl_init);