aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink/genetlink.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-25 06:16:51 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-25 06:16:51 -0400
commitd02859ecb321c8c0f74cb9bbe3f51a59e58822b0 (patch)
tree05dd5bdc55081c0a90bf0afc35c07d0d6e25d015 /net/netlink/genetlink.c
parenta987b16cc6123af2c9414032701bab5f73c54c89 (diff)
parent543cf4cb3fe6f6cae3651ba918b9c56200b257d0 (diff)
Merge commit 'v2.6.26-rc8' into x86/xen
Conflicts: arch/x86/xen/enlighten.c arch/x86/xen/mmu.c Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'net/netlink/genetlink.c')
-rw-r--r--net/netlink/genetlink.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index f5aa23c3e88..3e1191cecaf 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -444,8 +444,11 @@ static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
444 if (ops->dumpit == NULL) 444 if (ops->dumpit == NULL)
445 return -EOPNOTSUPP; 445 return -EOPNOTSUPP;
446 446
447 return netlink_dump_start(genl_sock, skb, nlh, 447 genl_unlock();
448 ops->dumpit, ops->done); 448 err = netlink_dump_start(genl_sock, skb, nlh,
449 ops->dumpit, ops->done);
450 genl_lock();
451 return err;
449 } 452 }
450 453
451 if (ops->doit == NULL) 454 if (ops->doit == NULL)
@@ -603,9 +606,6 @@ static int ctrl_dumpfamily(struct sk_buff *skb, struct netlink_callback *cb)
603 int chains_to_skip = cb->args[0]; 606 int chains_to_skip = cb->args[0];
604 int fams_to_skip = cb->args[1]; 607 int fams_to_skip = cb->args[1];
605 608
606 if (chains_to_skip != 0)
607 genl_lock();
608
609 for (i = 0; i < GENL_FAM_TAB_SIZE; i++) { 609 for (i = 0; i < GENL_FAM_TAB_SIZE; i++) {
610 if (i < chains_to_skip) 610 if (i < chains_to_skip)
611 continue; 611 continue;
@@ -623,9 +623,6 @@ static int ctrl_dumpfamily(struct sk_buff *skb, struct netlink_callback *cb)
623 } 623 }
624 624
625errout: 625errout:
626 if (chains_to_skip != 0)
627 genl_unlock();
628
629 cb->args[0] = i; 626 cb->args[0] = i;
630 cb->args[1] = n; 627 cb->args[1] = n;
631 628
@@ -770,7 +767,7 @@ static int __init genl_init(void)
770 767
771 /* we'll bump the group number right afterwards */ 768 /* we'll bump the group number right afterwards */
772 genl_sock = netlink_kernel_create(&init_net, NETLINK_GENERIC, 0, 769 genl_sock = netlink_kernel_create(&init_net, NETLINK_GENERIC, 0,
773 genl_rcv, NULL, THIS_MODULE); 770 genl_rcv, &genl_mutex, THIS_MODULE);
774 if (genl_sock == NULL) 771 if (genl_sock == NULL)
775 panic("GENL: Cannot initialize generic netlink\n"); 772 panic("GENL: Cannot initialize generic netlink\n");
776 773