aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-19 10:52:45 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-19 10:52:45 -0500
commit07ce198a1eb3431d04a6d59ea9fb7b71f21e33b1 (patch)
treefe6e6208bdcdfb7bbb0c81923efcb75bf73a299b /net
parent4bc87e62775052aac0be7574d5f84ff06f61c6b4 (diff)
parenta442585952f137bd4cdb1f2f3166e4157d383b82 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (60 commits) [NIU]: Bump driver version and release date. [NIU]: Fix BMAC alternate MAC address indexing. net: fix kernel-doc warnings in header files [IPV6]: Use BUG_ON instead of if + BUG in fib6_del_route. [IPV6]: dst_entry leak in ip4ip6_err. (resend) bluetooth: do not move child device other than rfcomm bluetooth: put hci dev after del conn [NET]: Elminate spurious print_mac() calls. [BLUETOOTH] hci_sysfs.c: Kill build warning. [NET]: Remove MAC_FMT net/8021q/vlan_dev.c: Use print_mac. [XFRM]: Fix ordering issue in xfrm_dst_hash_transfer(). [BLUETOOTH] net/bluetooth/hci_core.c: Use time_* macros [IPV6]: Fix hardcoded removing of old module code [NETLABEL]: Move some initialization code into __init section. [NETLABEL]: Shrink the genl-ops registration code. [AX25] ax25_out: check skb for NULL in ax25_kick() [TCP]: Fix tcp_v4_send_synack() comment [IPV4]: fix alignment of IP-Config output Documentation: fix tcp.txt ...
Diffstat (limited to 'net')
-rw-r--r--net/8021q/vlan_dev.c10
-rw-r--r--net/9p/trans_virtio.c3
-rw-r--r--net/ax25/ax25_out.c13
-rw-r--r--net/bluetooth/hci_conn.c1
-rw-r--r--net/bluetooth/hci_core.c5
-rw-r--r--net/bluetooth/hci_sysfs.c24
-rw-r--r--net/core/neighbour.c12
-rw-r--r--net/core/rtnetlink.c36
-rw-r--r--net/ipv4/arp.c3
-rw-r--r--net/ipv4/ipconfig.c2
-rw-r--r--net/ipv4/tcp_ipv4.c2
-rw-r--r--net/ipv6/af_inet6.c8
-rw-r--r--net/ipv6/ip6_fib.c2
-rw-r--r--net/ipv6/ip6_tunnel.c1
-rw-r--r--net/mac80211/ieee80211.c5
-rw-r--r--net/netlabel/netlabel_cipso_v4.c45
-rw-r--r--net/netlabel/netlabel_domainhash.c2
-rw-r--r--net/netlabel/netlabel_mgmt.c81
-rw-r--r--net/netlabel/netlabel_unlabeled.c92
-rw-r--r--net/netlabel/netlabel_user.c2
-rw-r--r--net/rxrpc/ar-accept.c3
-rw-r--r--net/rxrpc/ar-ack.c3
-rw-r--r--net/xfrm/xfrm_policy.c20
23 files changed, 155 insertions, 220 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 77f04e49a1a0..fc60c6d096b9 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -366,7 +366,8 @@ static int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
366{ 366{
367 struct net_device_stats *stats = &dev->stats; 367 struct net_device_stats *stats = &dev->stats;
368 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data); 368 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data);
369 369 DECLARE_MAC_BUF(mac);
370 DECLARE_MAC_BUF(mac2);
370 /* Handle non-VLAN frames if they are sent to us, for example by DHCP. 371 /* Handle non-VLAN frames if they are sent to us, for example by DHCP.
371 * 372 *
372 * NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING 373 * NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING
@@ -404,11 +405,8 @@ static int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
404 405
405 pr_debug("%s: about to send skb: %p to dev: %s\n", 406 pr_debug("%s: about to send skb: %p to dev: %s\n",
406 __FUNCTION__, skb, skb->dev->name); 407 __FUNCTION__, skb, skb->dev->name);
407 pr_debug(" " MAC_FMT " " MAC_FMT " %4hx %4hx %4hx\n", 408 pr_debug(" %s %s %4hx %4hx %4hx\n",
408 veth->h_dest[0], veth->h_dest[1], veth->h_dest[2], 409 print_mac(mac, veth->h_dest), print_mac(mac2, veth->h_source),
409 veth->h_dest[3], veth->h_dest[4], veth->h_dest[5],
410 veth->h_source[0], veth->h_source[1], veth->h_source[2],
411 veth->h_source[3], veth->h_source[4], veth->h_source[5],
412 veth->h_vlan_proto, veth->h_vlan_TCI, 410 veth->h_vlan_proto, veth->h_vlan_TCI,
413 veth->h_vlan_encapsulated_proto); 411 veth->h_vlan_encapsulated_proto);
414 412
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 0117b9fb8480..9e3d81cb9f08 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -183,8 +183,7 @@ pack_sg_list(struct scatterlist *sg, int start, int limit, char *data,
183 sg_set_buf(&sg[index++], data, s); 183 sg_set_buf(&sg[index++], data, s);
184 count -= s; 184 count -= s;
185 data += s; 185 data += s;
186 if (index > limit) 186 BUG_ON(index > limit);
187 BUG();
188 } 187 }
189 188
190 return index-start; 189 return index-start;
diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c
index 92b517af7260..bf706f83a5c9 100644
--- a/net/ax25/ax25_out.c
+++ b/net/ax25/ax25_out.c
@@ -117,6 +117,12 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb)
117 unsigned char *p; 117 unsigned char *p;
118 int frontlen, len, fragno, ka9qfrag, first = 1; 118 int frontlen, len, fragno, ka9qfrag, first = 1;
119 119
120 if (paclen < 16) {
121 WARN_ON_ONCE(1);
122 kfree_skb(skb);
123 return;
124 }
125
120 if ((skb->len - 1) > paclen) { 126 if ((skb->len - 1) > paclen) {
121 if (*skb->data == AX25_P_TEXT) { 127 if (*skb->data == AX25_P_TEXT) {
122 skb_pull(skb, 1); /* skip PID */ 128 skb_pull(skb, 1); /* skip PID */
@@ -251,8 +257,6 @@ void ax25_kick(ax25_cb *ax25)
251 if (start == end) 257 if (start == end)
252 return; 258 return;
253 259
254 ax25->vs = start;
255
256 /* 260 /*
257 * Transmit data until either we're out of data to send or 261 * Transmit data until either we're out of data to send or
258 * the window is full. Send a poll on the final I frame if 262 * the window is full. Send a poll on the final I frame if
@@ -261,8 +265,13 @@ void ax25_kick(ax25_cb *ax25)
261 265
262 /* 266 /*
263 * Dequeue the frame and copy it. 267 * Dequeue the frame and copy it.
268 * Check for race with ax25_clear_queues().
264 */ 269 */
265 skb = skb_dequeue(&ax25->write_queue); 270 skb = skb_dequeue(&ax25->write_queue);
271 if (!skb)
272 return;
273
274 ax25->vs = start;
266 275
267 do { 276 do {
268 if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) { 277 if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) {
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 5fc7be206f62..f8880261da0e 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -260,7 +260,6 @@ int hci_conn_del(struct hci_conn *conn)
260 tasklet_enable(&hdev->tx_task); 260 tasklet_enable(&hdev->tx_task);
261 skb_queue_purge(&conn->data_q); 261 skb_queue_purge(&conn->data_q);
262 hci_conn_del_sysfs(conn); 262 hci_conn_del_sysfs(conn);
263 hci_dev_put(hdev);
264 263
265 return 0; 264 return 0;
266} 265}
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 372b0d3b75a8..930b58e7149a 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -24,6 +24,7 @@
24 24
25/* Bluetooth HCI core. */ 25/* Bluetooth HCI core. */
26 26
27#include <linux/jiffies.h>
27#include <linux/module.h> 28#include <linux/module.h>
28#include <linux/kmod.h> 29#include <linux/kmod.h>
29 30
@@ -1321,7 +1322,7 @@ static inline void hci_sched_acl(struct hci_dev *hdev)
1321 if (!test_bit(HCI_RAW, &hdev->flags)) { 1322 if (!test_bit(HCI_RAW, &hdev->flags)) {
1322 /* ACL tx timeout must be longer than maximum 1323 /* ACL tx timeout must be longer than maximum
1323 * link supervision timeout (40.9 seconds) */ 1324 * link supervision timeout (40.9 seconds) */
1324 if (!hdev->acl_cnt && (jiffies - hdev->acl_last_tx) > (HZ * 45)) 1325 if (!hdev->acl_cnt && time_after(jiffies, hdev->acl_last_tx + HZ * 45))
1325 hci_acl_tx_to(hdev); 1326 hci_acl_tx_to(hdev);
1326 } 1327 }
1327 1328
@@ -1543,7 +1544,7 @@ static void hci_cmd_task(unsigned long arg)
1543 1544
1544 BT_DBG("%s cmd %d", hdev->name, atomic_read(&hdev->cmd_cnt)); 1545 BT_DBG("%s cmd %d", hdev->name, atomic_read(&hdev->cmd_cnt));
1545 1546
1546 if (!atomic_read(&hdev->cmd_cnt) && (jiffies - hdev->cmd_last_tx) > HZ) { 1547 if (!atomic_read(&hdev->cmd_cnt) && time_after(jiffies, hdev->cmd_last_tx + HZ)) {
1547 BT_ERR("%s command tx timeout", hdev->name); 1548 BT_ERR("%s command tx timeout", hdev->name);
1548 atomic_set(&hdev->cmd_cnt, 1); 1549 atomic_set(&hdev->cmd_cnt, 1);
1549 } 1550 }
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index e13cf5ef144c..84360c117d4e 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -320,28 +320,34 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
320 queue_work(btaddconn, &conn->work); 320 queue_work(btaddconn, &conn->work);
321} 321}
322 322
323/*
324 * The rfcomm tty device will possibly retain even when conn
325 * is down, and sysfs doesn't support move zombie device,
326 * so we should move the device before conn device is destroyed.
327 */
323static int __match_tty(struct device *dev, void *data) 328static int __match_tty(struct device *dev, void *data)
324{ 329{
325 /* The rfcomm tty device will possibly retain even when conn 330 return !strncmp(dev->bus_id, "rfcomm", 6);
326 * is down, and sysfs doesn't support move zombie device,
327 * so we should move the device before conn device is destroyed.
328 * Due to the only child device of hci_conn dev is rfcomm
329 * tty_dev, here just return 1
330 */
331 return 1;
332} 331}
333 332
334static void del_conn(struct work_struct *work) 333static void del_conn(struct work_struct *work)
335{ 334{
336 struct device *dev;
337 struct hci_conn *conn = container_of(work, struct hci_conn, work); 335 struct hci_conn *conn = container_of(work, struct hci_conn, work);
336 struct hci_dev *hdev = conn->hdev;
337
338 while (1) {
339 struct device *dev;
338 340
339 while (dev = device_find_child(&conn->dev, NULL, __match_tty)) { 341 dev = device_find_child(&conn->dev, NULL, __match_tty);
342 if (!dev)
343 break;
340 device_move(dev, NULL); 344 device_move(dev, NULL);
341 put_device(dev); 345 put_device(dev);
342 } 346 }
347
343 device_del(&conn->dev); 348 device_del(&conn->dev);
344 put_device(&conn->dev); 349 put_device(&conn->dev);
350 hci_dev_put(hdev);
345} 351}
346 352
347void hci_conn_del_sysfs(struct hci_conn *conn) 353void hci_conn_del_sysfs(struct hci_conn *conn)
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 7bb6a9a1256d..a16cf1ec5e5e 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -834,12 +834,18 @@ static void neigh_timer_handler(unsigned long arg)
834 } 834 }
835 if (neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) { 835 if (neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) {
836 struct sk_buff *skb = skb_peek(&neigh->arp_queue); 836 struct sk_buff *skb = skb_peek(&neigh->arp_queue);
837 837 /* keep skb alive even if arp_queue overflows */
838 if (skb)
839 skb_get(skb);
840 write_unlock(&neigh->lock);
838 neigh->ops->solicit(neigh, skb); 841 neigh->ops->solicit(neigh, skb);
839 atomic_inc(&neigh->probes); 842 atomic_inc(&neigh->probes);
840 } 843 if (skb)
844 kfree_skb(skb);
845 } else {
841out: 846out:
842 write_unlock(&neigh->lock); 847 write_unlock(&neigh->lock);
848 }
843 849
844 if (notify) 850 if (notify)
845 neigh_update_notify(neigh); 851 neigh_update_notify(neigh);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index ecb02afd52dc..61ac8d06292c 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -504,7 +504,7 @@ int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, u32 id,
504 504
505EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo); 505EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo);
506 506
507static int set_operstate(struct net_device *dev, unsigned char transition, bool send_notification) 507static void set_operstate(struct net_device *dev, unsigned char transition)
508{ 508{
509 unsigned char operstate = dev->operstate; 509 unsigned char operstate = dev->operstate;
510 510
@@ -527,12 +527,8 @@ static int set_operstate(struct net_device *dev, unsigned char transition, bool
527 write_lock_bh(&dev_base_lock); 527 write_lock_bh(&dev_base_lock);
528 dev->operstate = operstate; 528 dev->operstate = operstate;
529 write_unlock_bh(&dev_base_lock); 529 write_unlock_bh(&dev_base_lock);
530 530 netdev_state_change(dev);
531 if (send_notification) 531 }
532 netdev_state_change(dev);
533 return 1;
534 } else
535 return 0;
536} 532}
537 533
538static void copy_rtnl_link_stats(struct rtnl_link_stats *a, 534static void copy_rtnl_link_stats(struct rtnl_link_stats *a,
@@ -826,7 +822,6 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
826 if (tb[IFLA_BROADCAST]) { 822 if (tb[IFLA_BROADCAST]) {
827 nla_memcpy(dev->broadcast, tb[IFLA_BROADCAST], dev->addr_len); 823 nla_memcpy(dev->broadcast, tb[IFLA_BROADCAST], dev->addr_len);
828 send_addr_notify = 1; 824 send_addr_notify = 1;
829 modified = 1;
830 } 825 }
831 826
832 if (ifm->ifi_flags || ifm->ifi_change) { 827 if (ifm->ifi_flags || ifm->ifi_change) {
@@ -839,23 +834,16 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
839 dev_change_flags(dev, flags); 834 dev_change_flags(dev, flags);
840 } 835 }
841 836
842 if (tb[IFLA_TXQLEN]) { 837 if (tb[IFLA_TXQLEN])
843 if (dev->tx_queue_len != nla_get_u32(tb[IFLA_TXQLEN])) { 838 dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
844 dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
845 modified = 1;
846 }
847 }
848 839
849 if (tb[IFLA_OPERSTATE]) 840 if (tb[IFLA_OPERSTATE])
850 modified |= set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), false); 841 set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
851 842
852 if (tb[IFLA_LINKMODE]) { 843 if (tb[IFLA_LINKMODE]) {
853 if (dev->link_mode != nla_get_u8(tb[IFLA_LINKMODE])) { 844 write_lock_bh(&dev_base_lock);
854 write_lock_bh(&dev_base_lock); 845 dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
855 dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]); 846 write_unlock_bh(&dev_base_lock);
856 write_lock_bh(&dev_base_lock);
857 modified = 1;
858 }
859 } 847 }
860 848
861 err = 0; 849 err = 0;
@@ -869,10 +857,6 @@ errout:
869 857
870 if (send_addr_notify) 858 if (send_addr_notify)
871 call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); 859 call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
872
873 if (modified)
874 netdev_state_change(dev);
875
876 return err; 860 return err;
877} 861}
878 862
@@ -990,7 +974,7 @@ struct net_device *rtnl_create_link(struct net *net, char *ifname,
990 if (tb[IFLA_TXQLEN]) 974 if (tb[IFLA_TXQLEN])
991 dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]); 975 dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
992 if (tb[IFLA_OPERSTATE]) 976 if (tb[IFLA_OPERSTATE])
993 set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), true); 977 set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
994 if (tb[IFLA_LINKMODE]) 978 if (tb[IFLA_LINKMODE])
995 dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]); 979 dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
996 980
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index c663fa5339ee..8e17f65f4002 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -368,6 +368,7 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb)
368 if (!(neigh->nud_state&NUD_VALID)) 368 if (!(neigh->nud_state&NUD_VALID))
369 printk(KERN_DEBUG "trying to ucast probe in NUD_INVALID\n"); 369 printk(KERN_DEBUG "trying to ucast probe in NUD_INVALID\n");
370 dst_ha = neigh->ha; 370 dst_ha = neigh->ha;
371 read_lock_bh(&neigh->lock);
371 } else if ((probes -= neigh->parms->app_probes) < 0) { 372 } else if ((probes -= neigh->parms->app_probes) < 0) {
372#ifdef CONFIG_ARPD 373#ifdef CONFIG_ARPD
373 neigh_app_ns(neigh); 374 neigh_app_ns(neigh);
@@ -377,6 +378,8 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb)
377 378
378 arp_send(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr, 379 arp_send(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr,
379 dst_ha, dev->dev_addr, NULL); 380 dst_ha, dev->dev_addr, NULL);
381 if (dst_ha)
382 read_unlock_bh(&neigh->lock);
380} 383}
381 384
382static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip) 385static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip)
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index a52b5853aaa8..10013ccee8dd 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1390,7 +1390,7 @@ static int __init ip_auto_config(void)
1390 * Clue in the operator. 1390 * Clue in the operator.
1391 */ 1391 */
1392 printk("IP-Config: Complete:"); 1392 printk("IP-Config: Complete:");
1393 printk("\n device=%s", ic_dev->name); 1393 printk("\n device=%s", ic_dev->name);
1394 printk(", addr=%u.%u.%u.%u", NIPQUAD(ic_myaddr)); 1394 printk(", addr=%u.%u.%u.%u", NIPQUAD(ic_myaddr));
1395 printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask)); 1395 printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask));
1396 printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway)); 1396 printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway));
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 63414ea427c5..00156bf421ca 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -719,7 +719,7 @@ static void tcp_v4_reqsk_send_ack(struct sk_buff *skb,
719} 719}
720 720
721/* 721/*
722 * Send a SYN-ACK after having received an ACK. 722 * Send a SYN-ACK after having received a SYN.
723 * This still operates on a request_sock only, not on a big 723 * This still operates on a request_sock only, not on a big
724 * socket. 724 * socket.
725 */ 725 */
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index bddac0e8780f..f0aa97738746 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -752,14 +752,6 @@ static int __init inet6_init(void)
752 752
753 BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb)); 753 BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb));
754 754
755#ifdef MODULE
756#if 0 /* FIXME --RR */
757 if (!mod_member_present(&__this_module, can_unload))
758 return -EINVAL;
759
760 __this_module.can_unload = &ipv6_unload;
761#endif
762#endif
763 err = proto_register(&tcpv6_prot, 1); 755 err = proto_register(&tcpv6_prot, 1);
764 if (err) 756 if (err)
765 goto out; 757 goto out;
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index f93407cf6515..bab72b6f1444 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1151,7 +1151,7 @@ static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp,
1151 fn = fn->parent; 1151 fn = fn->parent;
1152 } 1152 }
1153 /* No more references are possible at this point. */ 1153 /* No more references are possible at this point. */
1154 if (atomic_read(&rt->rt6i_ref) != 1) BUG(); 1154 BUG_ON(atomic_read(&rt->rt6i_ref) != 1);
1155 } 1155 }
1156 1156
1157 inet6_rt_notify(RTM_DELROUTE, rt, info); 1157 inet6_rt_notify(RTM_DELROUTE, rt, info);
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 9031e521c1df..cd940647bd12 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -550,6 +550,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
550 ip_rt_put(rt); 550 ip_rt_put(rt);
551 goto out; 551 goto out;
552 } 552 }
553 skb2->dst = (struct dst_entry *)rt;
553 } else { 554 } else {
554 ip_rt_put(rt); 555 ip_rt_put(rt);
555 if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos, 556 if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos,
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 67b7c75c430d..28bcdf9fc3df 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -165,6 +165,7 @@ static int ieee80211_open(struct net_device *dev)
165 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 165 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
166 struct ieee80211_if_init_conf conf; 166 struct ieee80211_if_init_conf conf;
167 int res; 167 int res;
168 bool need_hw_reconfig = 0;
168 169
169 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 170 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
170 171
@@ -218,7 +219,7 @@ static int ieee80211_open(struct net_device *dev)
218 res = local->ops->start(local_to_hw(local)); 219 res = local->ops->start(local_to_hw(local));
219 if (res) 220 if (res)
220 return res; 221 return res;
221 ieee80211_hw_config(local); 222 need_hw_reconfig = 1;
222 ieee80211_led_radio(local, local->hw.conf.radio_enabled); 223 ieee80211_led_radio(local, local->hw.conf.radio_enabled);
223 } 224 }
224 225
@@ -282,6 +283,8 @@ static int ieee80211_open(struct net_device *dev)
282 atomic_inc(&local->iff_promiscs); 283 atomic_inc(&local->iff_promiscs);
283 284
284 local->open_count++; 285 local->open_count++;
286 if (need_hw_reconfig)
287 ieee80211_hw_config(local);
285 288
286 netif_start_queue(dev); 289 netif_start_queue(dev);
287 290
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c
index c7ad64d664ad..fdc14a0d21af 100644
--- a/net/netlabel/netlabel_cipso_v4.c
+++ b/net/netlabel/netlabel_cipso_v4.c
@@ -718,36 +718,35 @@ static int netlbl_cipsov4_remove(struct sk_buff *skb, struct genl_info *info)
718 * NetLabel Generic NETLINK Command Definitions 718 * NetLabel Generic NETLINK Command Definitions
719 */ 719 */
720 720
721static struct genl_ops netlbl_cipsov4_genl_c_add = { 721static struct genl_ops netlbl_cipsov4_ops[] = {
722 {
722 .cmd = NLBL_CIPSOV4_C_ADD, 723 .cmd = NLBL_CIPSOV4_C_ADD,
723 .flags = GENL_ADMIN_PERM, 724 .flags = GENL_ADMIN_PERM,
724 .policy = netlbl_cipsov4_genl_policy, 725 .policy = netlbl_cipsov4_genl_policy,
725 .doit = netlbl_cipsov4_add, 726 .doit = netlbl_cipsov4_add,
726 .dumpit = NULL, 727 .dumpit = NULL,
727}; 728 },
728 729 {
729static struct genl_ops netlbl_cipsov4_genl_c_remove = {
730 .cmd = NLBL_CIPSOV4_C_REMOVE, 730 .cmd = NLBL_CIPSOV4_C_REMOVE,
731 .flags = GENL_ADMIN_PERM, 731 .flags = GENL_ADMIN_PERM,
732 .policy = netlbl_cipsov4_genl_policy, 732 .policy = netlbl_cipsov4_genl_policy,
733 .doit = netlbl_cipsov4_remove, 733 .doit = netlbl_cipsov4_remove,
734 .dumpit = NULL, 734 .dumpit = NULL,
735}; 735 },
736 736 {
737static struct genl_ops netlbl_cipsov4_genl_c_list = {
738 .cmd = NLBL_CIPSOV4_C_LIST, 737 .cmd = NLBL_CIPSOV4_C_LIST,
739 .flags = 0, 738 .flags = 0,
740 .policy = netlbl_cipsov4_genl_policy, 739 .policy = netlbl_cipsov4_genl_policy,
741 .doit = netlbl_cipsov4_list, 740 .doit = netlbl_cipsov4_list,
742 .dumpit = NULL, 741 .dumpit = NULL,
743}; 742 },
744 743 {
745static struct genl_ops netlbl_cipsov4_genl_c_listall = {
746 .cmd = NLBL_CIPSOV4_C_LISTALL, 744 .cmd = NLBL_CIPSOV4_C_LISTALL,
747 .flags = 0, 745 .flags = 0,
748 .policy = netlbl_cipsov4_genl_policy, 746 .policy = netlbl_cipsov4_genl_policy,
749 .doit = NULL, 747 .doit = NULL,
750 .dumpit = netlbl_cipsov4_listall, 748 .dumpit = netlbl_cipsov4_listall,
749 },
751}; 750};
752 751
753/* 752/*
@@ -762,30 +761,20 @@ static struct genl_ops netlbl_cipsov4_genl_c_listall = {
762 * mechanism. Returns zero on success, negative values on failure. 761 * mechanism. Returns zero on success, negative values on failure.
763 * 762 *
764 */ 763 */
765int netlbl_cipsov4_genl_init(void) 764int __init netlbl_cipsov4_genl_init(void)
766{ 765{
767 int ret_val; 766 int ret_val, i;
768 767
769 ret_val = genl_register_family(&netlbl_cipsov4_gnl_family); 768 ret_val = genl_register_family(&netlbl_cipsov4_gnl_family);
770 if (ret_val != 0) 769 if (ret_val != 0)
771 return ret_val; 770 return ret_val;
772 771
773 ret_val = genl_register_ops(&netlbl_cipsov4_gnl_family, 772 for (i = 0; i < ARRAY_SIZE(netlbl_cipsov4_ops); i++) {
774 &netlbl_cipsov4_genl_c_add); 773 ret_val = genl_register_ops(&netlbl_cipsov4_gnl_family,
775 if (ret_val != 0) 774 &netlbl_cipsov4_ops[i]);
776 return ret_val; 775 if (ret_val != 0)
777 ret_val = genl_register_ops(&netlbl_cipsov4_gnl_family, 776 return ret_val;
778 &netlbl_cipsov4_genl_c_remove); 777 }
779 if (ret_val != 0)
780 return ret_val;
781 ret_val = genl_register_ops(&netlbl_cipsov4_gnl_family,
782 &netlbl_cipsov4_genl_c_list);
783 if (ret_val != 0)
784 return ret_val;
785 ret_val = genl_register_ops(&netlbl_cipsov4_gnl_family,
786 &netlbl_cipsov4_genl_c_listall);
787 if (ret_val != 0)
788 return ret_val;
789 778
790 return 0; 779 return 0;
791} 780}
diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c
index fd462313471c..02c2f7c0b255 100644
--- a/net/netlabel/netlabel_domainhash.c
+++ b/net/netlabel/netlabel_domainhash.c
@@ -171,7 +171,7 @@ static struct netlbl_dom_map *netlbl_domhsh_search_def(const char *domain)
171 * values on error. 171 * values on error.
172 * 172 *
173 */ 173 */
174int netlbl_domhsh_init(u32 size) 174int __init netlbl_domhsh_init(u32 size)
175{ 175{
176 u32 iter; 176 u32 iter;
177 struct netlbl_domhsh_tbl *hsh_tbl; 177 struct netlbl_domhsh_tbl *hsh_tbl;
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c
index e2258dc3c845..22c191267808 100644
--- a/net/netlabel/netlabel_mgmt.c
+++ b/net/netlabel/netlabel_mgmt.c
@@ -517,68 +517,63 @@ version_failure:
517 * NetLabel Generic NETLINK Command Definitions 517 * NetLabel Generic NETLINK Command Definitions
518 */ 518 */
519 519
520static struct genl_ops netlbl_mgmt_genl_c_add = { 520static struct genl_ops netlbl_mgmt_genl_ops[] = {
521 {
521 .cmd = NLBL_MGMT_C_ADD, 522 .cmd = NLBL_MGMT_C_ADD,
522 .flags = GENL_ADMIN_PERM, 523 .flags = GENL_ADMIN_PERM,
523 .policy = netlbl_mgmt_genl_policy, 524 .policy = netlbl_mgmt_genl_policy,
524 .doit = netlbl_mgmt_add, 525 .doit = netlbl_mgmt_add,
525 .dumpit = NULL, 526 .dumpit = NULL,
526}; 527 },
527 528 {
528static struct genl_ops netlbl_mgmt_genl_c_remove = {
529 .cmd = NLBL_MGMT_C_REMOVE, 529 .cmd = NLBL_MGMT_C_REMOVE,
530 .flags = GENL_ADMIN_PERM, 530 .flags = GENL_ADMIN_PERM,
531 .policy = netlbl_mgmt_genl_policy, 531 .policy = netlbl_mgmt_genl_policy,
532 .doit = netlbl_mgmt_remove, 532 .doit = netlbl_mgmt_remove,
533 .dumpit = NULL, 533 .dumpit = NULL,
534}; 534 },
535 535 {
536static struct genl_ops netlbl_mgmt_genl_c_listall = {
537 .cmd = NLBL_MGMT_C_LISTALL, 536 .cmd = NLBL_MGMT_C_LISTALL,
538 .flags = 0, 537 .flags = 0,
539 .policy = netlbl_mgmt_genl_policy, 538 .policy = netlbl_mgmt_genl_policy,
540 .doit = NULL, 539 .doit = NULL,
541 .dumpit = netlbl_mgmt_listall, 540 .dumpit = netlbl_mgmt_listall,
542}; 541 },
543 542 {
544static struct genl_ops netlbl_mgmt_genl_c_adddef = {
545 .cmd = NLBL_MGMT_C_ADDDEF, 543 .cmd = NLBL_MGMT_C_ADDDEF,
546 .flags = GENL_ADMIN_PERM, 544 .flags = GENL_ADMIN_PERM,
547 .policy = netlbl_mgmt_genl_policy, 545 .policy = netlbl_mgmt_genl_policy,
548 .doit = netlbl_mgmt_adddef, 546 .doit = netlbl_mgmt_adddef,
549 .dumpit = NULL, 547 .dumpit = NULL,
550}; 548 },
551 549 {
552static struct genl_ops netlbl_mgmt_genl_c_removedef = {
553 .cmd = NLBL_MGMT_C_REMOVEDEF, 550 .cmd = NLBL_MGMT_C_REMOVEDEF,
554 .flags = GENL_ADMIN_PERM, 551 .flags = GENL_ADMIN_PERM,
555 .policy = netlbl_mgmt_genl_policy, 552 .policy = netlbl_mgmt_genl_policy,
556 .doit = netlbl_mgmt_removedef, 553 .doit = netlbl_mgmt_removedef,
557 .dumpit = NULL, 554 .dumpit = NULL,
558}; 555 },
559 556 {
560static struct genl_ops netlbl_mgmt_genl_c_listdef = {
561 .cmd = NLBL_MGMT_C_LISTDEF, 557 .cmd = NLBL_MGMT_C_LISTDEF,
562 .flags = 0, 558 .flags = 0,
563 .policy = netlbl_mgmt_genl_policy, 559 .policy = netlbl_mgmt_genl_policy,
564 .doit = netlbl_mgmt_listdef, 560 .doit = netlbl_mgmt_listdef,
565 .dumpit = NULL, 561 .dumpit = NULL,
566}; 562 },
567 563 {
568static struct genl_ops netlbl_mgmt_genl_c_protocols = {
569 .cmd = NLBL_MGMT_C_PROTOCOLS, 564 .cmd = NLBL_MGMT_C_PROTOCOLS,
570 .flags = 0, 565 .flags = 0,
571 .policy = netlbl_mgmt_genl_policy, 566 .policy = netlbl_mgmt_genl_policy,
572 .doit = NULL, 567 .doit = NULL,
573 .dumpit = netlbl_mgmt_protocols, 568 .dumpit = netlbl_mgmt_protocols,
574}; 569 },
575 570 {
576static struct genl_ops netlbl_mgmt_genl_c_version = {
577 .cmd = NLBL_MGMT_C_VERSION, 571 .cmd = NLBL_MGMT_C_VERSION,
578 .flags = 0, 572 .flags = 0,
579 .policy = netlbl_mgmt_genl_policy, 573 .policy = netlbl_mgmt_genl_policy,
580 .doit = netlbl_mgmt_version, 574 .doit = netlbl_mgmt_version,
581 .dumpit = NULL, 575 .dumpit = NULL,
576 },
582}; 577};
583 578
584/* 579/*
@@ -593,46 +588,20 @@ static struct genl_ops netlbl_mgmt_genl_c_version = {
593 * mechanism. Returns zero on success, negative values on failure. 588 * mechanism. Returns zero on success, negative values on failure.
594 * 589 *
595 */ 590 */
596int netlbl_mgmt_genl_init(void) 591int __init netlbl_mgmt_genl_init(void)
597{ 592{
598 int ret_val; 593 int ret_val, i;
599 594
600 ret_val = genl_register_family(&netlbl_mgmt_gnl_family); 595 ret_val = genl_register_family(&netlbl_mgmt_gnl_family);
601 if (ret_val != 0) 596 if (ret_val != 0)
602 return ret_val; 597 return ret_val;
603 598
604 ret_val = genl_register_ops(&netlbl_mgmt_gnl_family, 599 for (i = 0; i < ARRAY_SIZE(netlbl_mgmt_genl_ops); i++) {
605 &netlbl_mgmt_genl_c_add); 600 ret_val = genl_register_ops(&netlbl_mgmt_gnl_family,
606 if (ret_val != 0) 601 &netlbl_mgmt_genl_ops[i]);
607 return ret_val; 602 if (ret_val != 0)
608 ret_val = genl_register_ops(&netlbl_mgmt_gnl_family, 603 return ret_val;
609 &netlbl_mgmt_genl_c_remove); 604 }
610 if (ret_val != 0)
611 return ret_val;
612 ret_val = genl_register_ops(&netlbl_mgmt_gnl_family,
613 &netlbl_mgmt_genl_c_listall);
614 if (ret_val != 0)
615 return ret_val;
616 ret_val = genl_register_ops(&netlbl_mgmt_gnl_family,
617 &netlbl_mgmt_genl_c_adddef);
618 if (ret_val != 0)
619 return ret_val;
620 ret_val = genl_register_ops(&netlbl_mgmt_gnl_family,
621 &netlbl_mgmt_genl_c_removedef);
622 if (ret_val != 0)
623 return ret_val;
624 ret_val = genl_register_ops(&netlbl_mgmt_gnl_family,
625 &netlbl_mgmt_genl_c_listdef);
626 if (ret_val != 0)
627 return ret_val;
628 ret_val = genl_register_ops(&netlbl_mgmt_gnl_family,
629 &netlbl_mgmt_genl_c_protocols);
630 if (ret_val != 0)
631 return ret_val;
632 ret_val = genl_register_ops(&netlbl_mgmt_gnl_family,
633 &netlbl_mgmt_genl_c_version);
634 if (ret_val != 0)
635 return ret_val;
636 605
637 return 0; 606 return 0;
638} 607}
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index 3e745b72fded..4478f2f6079d 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -1553,68 +1553,63 @@ unlabel_staticlistdef_return:
1553 * NetLabel Generic NETLINK Command Definitions 1553 * NetLabel Generic NETLINK Command Definitions
1554 */ 1554 */
1555 1555
1556static struct genl_ops netlbl_unlabel_genl_c_staticadd = { 1556static struct genl_ops netlbl_unlabel_genl_ops[] = {
1557 {
1557 .cmd = NLBL_UNLABEL_C_STATICADD, 1558 .cmd = NLBL_UNLABEL_C_STATICADD,
1558 .flags = GENL_ADMIN_PERM, 1559 .flags = GENL_ADMIN_PERM,
1559 .policy = netlbl_unlabel_genl_policy, 1560 .policy = netlbl_unlabel_genl_policy,
1560 .doit = netlbl_unlabel_staticadd, 1561 .doit = netlbl_unlabel_staticadd,
1561 .dumpit = NULL, 1562 .dumpit = NULL,
1562}; 1563 },
1563 1564 {
1564static struct genl_ops netlbl_unlabel_genl_c_staticremove = {
1565 .cmd = NLBL_UNLABEL_C_STATICREMOVE, 1565 .cmd = NLBL_UNLABEL_C_STATICREMOVE,
1566 .flags = GENL_ADMIN_PERM, 1566 .flags = GENL_ADMIN_PERM,
1567 .policy = netlbl_unlabel_genl_policy, 1567 .policy = netlbl_unlabel_genl_policy,
1568 .doit = netlbl_unlabel_staticremove, 1568 .doit = netlbl_unlabel_staticremove,
1569 .dumpit = NULL, 1569 .dumpit = NULL,
1570}; 1570 },
1571 1571 {
1572static struct genl_ops netlbl_unlabel_genl_c_staticlist = {
1573 .cmd = NLBL_UNLABEL_C_STATICLIST, 1572 .cmd = NLBL_UNLABEL_C_STATICLIST,
1574 .flags = 0, 1573 .flags = 0,
1575 .policy = netlbl_unlabel_genl_policy, 1574 .policy = netlbl_unlabel_genl_policy,
1576 .doit = NULL, 1575 .doit = NULL,
1577 .dumpit = netlbl_unlabel_staticlist, 1576 .dumpit = netlbl_unlabel_staticlist,
1578}; 1577 },
1579 1578 {
1580static struct genl_ops netlbl_unlabel_genl_c_staticadddef = {
1581 .cmd = NLBL_UNLABEL_C_STATICADDDEF, 1579 .cmd = NLBL_UNLABEL_C_STATICADDDEF,
1582 .flags = GENL_ADMIN_PERM, 1580 .flags = GENL_ADMIN_PERM,
1583 .policy = netlbl_unlabel_genl_policy, 1581 .policy = netlbl_unlabel_genl_policy,
1584 .doit = netlbl_unlabel_staticadddef, 1582 .doit = netlbl_unlabel_staticadddef,
1585 .dumpit = NULL, 1583 .dumpit = NULL,
1586}; 1584 },
1587 1585 {
1588static struct genl_ops netlbl_unlabel_genl_c_staticremovedef = {
1589 .cmd = NLBL_UNLABEL_C_STATICREMOVEDEF, 1586 .cmd = NLBL_UNLABEL_C_STATICREMOVEDEF,
1590 .flags = GENL_ADMIN_PERM, 1587 .flags = GENL_ADMIN_PERM,
1591 .policy = netlbl_unlabel_genl_policy, 1588 .policy = netlbl_unlabel_genl_policy,
1592 .doit = netlbl_unlabel_staticremovedef, 1589 .doit = netlbl_unlabel_staticremovedef,
1593 .dumpit = NULL, 1590 .dumpit = NULL,
1594}; 1591 },
1595 1592 {
1596static struct genl_ops netlbl_unlabel_genl_c_staticlistdef = {
1597 .cmd = NLBL_UNLABEL_C_STATICLISTDEF, 1593 .cmd = NLBL_UNLABEL_C_STATICLISTDEF,
1598 .flags = 0, 1594 .flags = 0,
1599 .policy = netlbl_unlabel_genl_policy, 1595 .policy = netlbl_unlabel_genl_policy,
1600 .doit = NULL, 1596 .doit = NULL,
1601 .dumpit = netlbl_unlabel_staticlistdef, 1597 .dumpit = netlbl_unlabel_staticlistdef,
1602}; 1598 },
1603 1599 {
1604static struct genl_ops netlbl_unlabel_genl_c_accept = {
1605 .cmd = NLBL_UNLABEL_C_ACCEPT, 1600 .cmd = NLBL_UNLABEL_C_ACCEPT,
1606 .flags = GENL_ADMIN_PERM, 1601 .flags = GENL_ADMIN_PERM,
1607 .policy = netlbl_unlabel_genl_policy, 1602 .policy = netlbl_unlabel_genl_policy,
1608 .doit = netlbl_unlabel_accept, 1603 .doit = netlbl_unlabel_accept,
1609 .dumpit = NULL, 1604 .dumpit = NULL,
1610}; 1605 },
1611 1606 {
1612static struct genl_ops netlbl_unlabel_genl_c_list = {
1613 .cmd = NLBL_UNLABEL_C_LIST, 1607 .cmd = NLBL_UNLABEL_C_LIST,
1614 .flags = 0, 1608 .flags = 0,
1615 .policy = netlbl_unlabel_genl_policy, 1609 .policy = netlbl_unlabel_genl_policy,
1616 .doit = netlbl_unlabel_list, 1610 .doit = netlbl_unlabel_list,
1617 .dumpit = NULL, 1611 .dumpit = NULL,
1612 },
1618}; 1613};
1619 1614
1620/* 1615/*
@@ -1629,53 +1624,20 @@ static struct genl_ops netlbl_unlabel_genl_c_list = {
1629 * mechanism. Returns zero on success, negative values on failure. 1624 * mechanism. Returns zero on success, negative values on failure.
1630 * 1625 *
1631 */ 1626 */
1632int netlbl_unlabel_genl_init(void) 1627int __init netlbl_unlabel_genl_init(void)
1633{ 1628{
1634 int ret_val; 1629 int ret_val, i;
1635 1630
1636 ret_val = genl_register_family(&netlbl_unlabel_gnl_family); 1631 ret_val = genl_register_family(&netlbl_unlabel_gnl_family);
1637 if (ret_val != 0) 1632 if (ret_val != 0)
1638 return ret_val; 1633 return ret_val;
1639 1634
1640 ret_val = genl_register_ops(&netlbl_unlabel_gnl_family, 1635 for (i = 0; i < ARRAY_SIZE(netlbl_unlabel_genl_ops); i++) {
1641 &netlbl_unlabel_genl_c_staticadd); 1636 ret_val = genl_register_ops(&netlbl_unlabel_gnl_family,
1642 if (ret_val != 0) 1637 &netlbl_unlabel_genl_ops[i]);
1643 return ret_val; 1638 if (ret_val != 0)
1644 1639 return ret_val;
1645 ret_val = genl_register_ops(&netlbl_unlabel_gnl_family, 1640 }
1646 &netlbl_unlabel_genl_c_staticremove);
1647 if (ret_val != 0)
1648 return ret_val;
1649
1650 ret_val = genl_register_ops(&netlbl_unlabel_gnl_family,
1651 &netlbl_unlabel_genl_c_staticlist);
1652 if (ret_val != 0)
1653 return ret_val;
1654
1655 ret_val = genl_register_ops(&netlbl_unlabel_gnl_family,
1656 &netlbl_unlabel_genl_c_staticadddef);
1657 if (ret_val != 0)
1658 return ret_val;
1659
1660 ret_val = genl_register_ops(&netlbl_unlabel_gnl_family,
1661 &netlbl_unlabel_genl_c_staticremovedef);
1662 if (ret_val != 0)
1663 return ret_val;
1664
1665 ret_val = genl_register_ops(&netlbl_unlabel_gnl_family,
1666 &netlbl_unlabel_genl_c_staticlistdef);
1667 if (ret_val != 0)
1668 return ret_val;
1669
1670 ret_val = genl_register_ops(&netlbl_unlabel_gnl_family,
1671 &netlbl_unlabel_genl_c_accept);
1672 if (ret_val != 0)
1673 return ret_val;
1674
1675 ret_val = genl_register_ops(&netlbl_unlabel_gnl_family,
1676 &netlbl_unlabel_genl_c_list);
1677 if (ret_val != 0)
1678 return ret_val;
1679 1641
1680 return 0; 1642 return 0;
1681} 1643}
@@ -1699,7 +1661,7 @@ static struct notifier_block netlbl_unlhsh_netdev_notifier = {
1699 * non-zero values on error. 1661 * non-zero values on error.
1700 * 1662 *
1701 */ 1663 */
1702int netlbl_unlabel_init(u32 size) 1664int __init netlbl_unlabel_init(u32 size)
1703{ 1665{
1704 u32 iter; 1666 u32 iter;
1705 struct netlbl_unlhsh_tbl *hsh_tbl; 1667 struct netlbl_unlhsh_tbl *hsh_tbl;
@@ -1803,7 +1765,7 @@ unlabel_getattr_nolabel:
1803 * and to send unlabeled network traffic by default. 1765 * and to send unlabeled network traffic by default.
1804 * 1766 *
1805 */ 1767 */
1806int netlbl_unlabel_defconf(void) 1768int __init netlbl_unlabel_defconf(void)
1807{ 1769{
1808 int ret_val; 1770 int ret_val;
1809 struct netlbl_dom_map *entry; 1771 struct netlbl_dom_map *entry;
diff --git a/net/netlabel/netlabel_user.c b/net/netlabel/netlabel_user.c
index 023fc8fe840d..b17d4203806e 100644
--- a/net/netlabel/netlabel_user.c
+++ b/net/netlabel/netlabel_user.c
@@ -59,7 +59,7 @@
59 * non-zero on failure. 59 * non-zero on failure.
60 * 60 *
61 */ 61 */
62int netlbl_netlink_init(void) 62int __init netlbl_netlink_init(void)
63{ 63{
64 int ret_val; 64 int ret_val;
65 65
diff --git a/net/rxrpc/ar-accept.c b/net/rxrpc/ar-accept.c
index 92a87fde8bfe..bdfb77417794 100644
--- a/net/rxrpc/ar-accept.c
+++ b/net/rxrpc/ar-accept.c
@@ -156,8 +156,7 @@ static int rxrpc_accept_incoming_call(struct rxrpc_local *local,
156 false); 156 false);
157 spin_unlock(&call->lock); 157 spin_unlock(&call->lock);
158 notification = NULL; 158 notification = NULL;
159 if (ret < 0) 159 BUG_ON(ret < 0);
160 BUG();
161 } 160 }
162 spin_unlock(&call->conn->state_lock); 161 spin_unlock(&call->conn->state_lock);
163 162
diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c
index 657ee69f2133..3ac1672e1070 100644
--- a/net/rxrpc/ar-ack.c
+++ b/net/rxrpc/ar-ack.c
@@ -814,8 +814,7 @@ static int rxrpc_post_message(struct rxrpc_call *call, u32 mark, u32 error,
814 spin_lock_bh(&call->lock); 814 spin_lock_bh(&call->lock);
815 ret = rxrpc_queue_rcv_skb(call, skb, true, fatal); 815 ret = rxrpc_queue_rcv_skb(call, skb, true, fatal);
816 spin_unlock_bh(&call->lock); 816 spin_unlock_bh(&call->lock);
817 if (ret < 0) 817 BUG_ON(ret < 0);
818 BUG();
819 } 818 }
820 819
821 return 0; 820 return 0;
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 47219f98053f..9fc4c315f6cd 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -331,15 +331,31 @@ static void xfrm_dst_hash_transfer(struct hlist_head *list,
331 struct hlist_head *ndsttable, 331 struct hlist_head *ndsttable,
332 unsigned int nhashmask) 332 unsigned int nhashmask)
333{ 333{
334 struct hlist_node *entry, *tmp; 334 struct hlist_node *entry, *tmp, *entry0 = NULL;
335 struct xfrm_policy *pol; 335 struct xfrm_policy *pol;
336 unsigned int h0 = 0;
336 337
338redo:
337 hlist_for_each_entry_safe(pol, entry, tmp, list, bydst) { 339 hlist_for_each_entry_safe(pol, entry, tmp, list, bydst) {
338 unsigned int h; 340 unsigned int h;
339 341
340 h = __addr_hash(&pol->selector.daddr, &pol->selector.saddr, 342 h = __addr_hash(&pol->selector.daddr, &pol->selector.saddr,
341 pol->family, nhashmask); 343 pol->family, nhashmask);
342 hlist_add_head(&pol->bydst, ndsttable+h); 344 if (!entry0) {
345 hlist_del(entry);
346 hlist_add_head(&pol->bydst, ndsttable+h);
347 h0 = h;
348 } else {
349 if (h != h0)
350 continue;
351 hlist_del(entry);
352 hlist_add_after(entry0, &pol->bydst);
353 }
354 entry0 = entry;
355 }
356 if (!hlist_empty(list)) {
357 entry0 = NULL;
358 goto redo;
343 } 359 }
344} 360}
345 361