diff options
Diffstat (limited to 'net/netlink')
-rw-r--r-- | net/netlink/genetlink.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 4ae1538c54a9..43e72419c868 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -238,7 +238,7 @@ int genl_register_family(struct genl_family *family) | |||
238 | sizeof(struct nlattr *), GFP_KERNEL); | 238 | sizeof(struct nlattr *), GFP_KERNEL); |
239 | if (family->attrbuf == NULL) { | 239 | if (family->attrbuf == NULL) { |
240 | err = -ENOMEM; | 240 | err = -ENOMEM; |
241 | goto errout; | 241 | goto errout_locked; |
242 | } | 242 | } |
243 | } else | 243 | } else |
244 | family->attrbuf = NULL; | 244 | family->attrbuf = NULL; |
@@ -288,7 +288,7 @@ int genl_unregister_family(struct genl_family *family) | |||
288 | return -ENOENT; | 288 | return -ENOENT; |
289 | } | 289 | } |
290 | 290 | ||
291 | static inline int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, | 291 | static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, |
292 | int *errp) | 292 | int *errp) |
293 | { | 293 | { |
294 | struct genl_ops *ops; | 294 | struct genl_ops *ops; |
@@ -375,7 +375,7 @@ static void genl_rcv(struct sock *sk, int len) | |||
375 | do { | 375 | do { |
376 | if (genl_trylock()) | 376 | if (genl_trylock()) |
377 | return; | 377 | return; |
378 | netlink_run_queue(sk, &qlen, &genl_rcv_msg); | 378 | netlink_run_queue(sk, &qlen, genl_rcv_msg); |
379 | genl_unlock(); | 379 | genl_unlock(); |
380 | } while (qlen && genl_sock && genl_sock->sk_receive_queue.qlen); | 380 | } while (qlen && genl_sock && genl_sock->sk_receive_queue.qlen); |
381 | } | 381 | } |
@@ -549,10 +549,8 @@ static int __init genl_init(void) | |||
549 | netlink_set_nonroot(NETLINK_GENERIC, NL_NONROOT_RECV); | 549 | netlink_set_nonroot(NETLINK_GENERIC, NL_NONROOT_RECV); |
550 | genl_sock = netlink_kernel_create(NETLINK_GENERIC, GENL_MAX_ID, | 550 | genl_sock = netlink_kernel_create(NETLINK_GENERIC, GENL_MAX_ID, |
551 | genl_rcv, THIS_MODULE); | 551 | genl_rcv, THIS_MODULE); |
552 | if (genl_sock == NULL) { | 552 | if (genl_sock == NULL) |
553 | panic("GENL: Cannot initialize generic netlink\n"); | 553 | panic("GENL: Cannot initialize generic netlink\n"); |
554 | return -ENOMEM; | ||
555 | } | ||
556 | 554 | ||
557 | return 0; | 555 | return 0; |
558 | 556 | ||
@@ -560,7 +558,6 @@ errout_register: | |||
560 | genl_unregister_family(&genl_ctrl); | 558 | genl_unregister_family(&genl_ctrl); |
561 | errout: | 559 | errout: |
562 | panic("GENL: Cannot register controller: %d\n", err); | 560 | panic("GENL: Cannot register controller: %d\n", err); |
563 | return err; | ||
564 | } | 561 | } |
565 | 562 | ||
566 | subsys_initcall(genl_init); | 563 | subsys_initcall(genl_init); |