diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/core/rtnetlink.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 648a7b6d15df..62f5c7f98d17 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -859,6 +859,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
859 | int min_len; | 859 | int min_len; |
860 | int family; | 860 | int family; |
861 | int type; | 861 | int type; |
862 | int err; | ||
862 | 863 | ||
863 | type = nlh->nlmsg_type; | 864 | type = nlh->nlmsg_type; |
864 | if (type > RTM_MAX) | 865 | if (type > RTM_MAX) |
@@ -887,7 +888,10 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
887 | if (dumpit == NULL) | 888 | if (dumpit == NULL) |
888 | return -EOPNOTSUPP; | 889 | return -EOPNOTSUPP; |
889 | 890 | ||
890 | return netlink_dump_start(rtnl, skb, nlh, dumpit, NULL); | 891 | __rtnl_unlock(); |
892 | err = netlink_dump_start(rtnl, skb, nlh, dumpit, NULL); | ||
893 | rtnl_lock(); | ||
894 | return err; | ||
891 | } | 895 | } |
892 | 896 | ||
893 | memset(rta_buf, 0, (rtattr_max * sizeof(struct rtattr *))); | 897 | memset(rta_buf, 0, (rtattr_max * sizeof(struct rtattr *))); |
@@ -972,7 +976,7 @@ void __init rtnetlink_init(void) | |||
972 | panic("rtnetlink_init: cannot allocate rta_buf\n"); | 976 | panic("rtnetlink_init: cannot allocate rta_buf\n"); |
973 | 977 | ||
974 | rtnl = netlink_kernel_create(NETLINK_ROUTE, RTNLGRP_MAX, rtnetlink_rcv, | 978 | rtnl = netlink_kernel_create(NETLINK_ROUTE, RTNLGRP_MAX, rtnetlink_rcv, |
975 | NULL, THIS_MODULE); | 979 | &rtnl_mutex, THIS_MODULE); |
976 | if (rtnl == NULL) | 980 | if (rtnl == NULL) |
977 | panic("rtnetlink_init: cannot initialize rtnetlink\n"); | 981 | panic("rtnetlink_init: cannot initialize rtnetlink\n"); |
978 | netlink_set_nonroot(NETLINK_ROUTE, NL_NONROOT_RECV); | 982 | netlink_set_nonroot(NETLINK_ROUTE, NL_NONROOT_RECV); |