diff options
33 files changed, 137 insertions, 90 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 5c1bc995e560..f10221f40803 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -123,7 +123,7 @@ static void ipoib_ud_skb_put_frags(struct ipoib_dev_priv *priv, | |||
123 | 123 | ||
124 | skb_frag_size_set(frag, size); | 124 | skb_frag_size_set(frag, size); |
125 | skb->data_len += size; | 125 | skb->data_len += size; |
126 | skb->truesize += size; | 126 | skb->truesize += PAGE_SIZE; |
127 | } else | 127 | } else |
128 | skb_put(skb, length); | 128 | skb_put(skb, length); |
129 | 129 | ||
@@ -156,14 +156,18 @@ static struct sk_buff *ipoib_alloc_rx_skb(struct net_device *dev, int id) | |||
156 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 156 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
157 | struct sk_buff *skb; | 157 | struct sk_buff *skb; |
158 | int buf_size; | 158 | int buf_size; |
159 | int tailroom; | ||
159 | u64 *mapping; | 160 | u64 *mapping; |
160 | 161 | ||
161 | if (ipoib_ud_need_sg(priv->max_ib_mtu)) | 162 | if (ipoib_ud_need_sg(priv->max_ib_mtu)) { |
162 | buf_size = IPOIB_UD_HEAD_SIZE; | 163 | buf_size = IPOIB_UD_HEAD_SIZE; |
163 | else | 164 | tailroom = 128; /* reserve some tailroom for IP/TCP headers */ |
165 | } else { | ||
164 | buf_size = IPOIB_UD_BUF_SIZE(priv->max_ib_mtu); | 166 | buf_size = IPOIB_UD_BUF_SIZE(priv->max_ib_mtu); |
167 | tailroom = 0; | ||
168 | } | ||
165 | 169 | ||
166 | skb = dev_alloc_skb(buf_size + 4); | 170 | skb = dev_alloc_skb(buf_size + tailroom + 4); |
167 | if (unlikely(!skb)) | 171 | if (unlikely(!skb)) |
168 | return NULL; | 172 | return NULL; |
169 | 173 | ||
diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c index 1a0ae4445ff2..5f21f629b7ae 100644 --- a/drivers/isdn/mISDN/stack.c +++ b/drivers/isdn/mISDN/stack.c | |||
@@ -135,8 +135,8 @@ send_layer2(struct mISDNstack *st, struct sk_buff *skb) | |||
135 | skb = NULL; | 135 | skb = NULL; |
136 | else if (*debug & DEBUG_SEND_ERR) | 136 | else if (*debug & DEBUG_SEND_ERR) |
137 | printk(KERN_DEBUG | 137 | printk(KERN_DEBUG |
138 | "%s ch%d mgr prim(%x) addr(%x) err %d\n", | 138 | "%s mgr prim(%x) err %d\n", |
139 | __func__, ch->nr, hh->prim, ch->addr, ret); | 139 | __func__, hh->prim, ret); |
140 | } | 140 | } |
141 | out: | 141 | out: |
142 | mutex_unlock(&st->lmutex); | 142 | mutex_unlock(&st->lmutex); |
diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c index 3680aa251dea..2cf084eb9d52 100644 --- a/drivers/net/bonding/bond_debugfs.c +++ b/drivers/net/bonding/bond_debugfs.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "bonding.h" | 6 | #include "bonding.h" |
7 | #include "bond_alb.h" | 7 | #include "bond_alb.h" |
8 | 8 | ||
9 | #ifdef CONFIG_DEBUG_FS | 9 | #if defined(CONFIG_DEBUG_FS) && !defined(CONFIG_NET_NS) |
10 | 10 | ||
11 | #include <linux/debugfs.h> | 11 | #include <linux/debugfs.h> |
12 | #include <linux/seq_file.h> | 12 | #include <linux/seq_file.h> |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index f5a40b925f5e..4ddcc3e41dab 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -3230,6 +3230,12 @@ static int bond_master_netdev_event(unsigned long event, | |||
3230 | switch (event) { | 3230 | switch (event) { |
3231 | case NETDEV_CHANGENAME: | 3231 | case NETDEV_CHANGENAME: |
3232 | return bond_event_changename(event_bond); | 3232 | return bond_event_changename(event_bond); |
3233 | case NETDEV_UNREGISTER: | ||
3234 | bond_remove_proc_entry(event_bond); | ||
3235 | break; | ||
3236 | case NETDEV_REGISTER: | ||
3237 | bond_create_proc_entry(event_bond); | ||
3238 | break; | ||
3233 | default: | 3239 | default: |
3234 | break; | 3240 | break; |
3235 | } | 3241 | } |
@@ -4414,8 +4420,6 @@ static void bond_uninit(struct net_device *bond_dev) | |||
4414 | 4420 | ||
4415 | bond_work_cancel_all(bond); | 4421 | bond_work_cancel_all(bond); |
4416 | 4422 | ||
4417 | bond_remove_proc_entry(bond); | ||
4418 | |||
4419 | bond_debug_unregister(bond); | 4423 | bond_debug_unregister(bond); |
4420 | 4424 | ||
4421 | __hw_addr_flush(&bond->mc_list); | 4425 | __hw_addr_flush(&bond->mc_list); |
@@ -4817,7 +4821,6 @@ static int bond_init(struct net_device *bond_dev) | |||
4817 | 4821 | ||
4818 | bond_set_lockdep_class(bond_dev); | 4822 | bond_set_lockdep_class(bond_dev); |
4819 | 4823 | ||
4820 | bond_create_proc_entry(bond); | ||
4821 | list_add_tail(&bond->bond_list, &bn->dev_list); | 4824 | list_add_tail(&bond->bond_list, &bn->dev_list); |
4822 | 4825 | ||
4823 | bond_prepare_sysfs_group(bond); | 4826 | bond_prepare_sysfs_group(bond); |
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c index 42c13d8280c6..36d3783ebfa0 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | |||
@@ -261,7 +261,6 @@ static void atl1c_check_link_status(struct atl1c_adapter *adapter) | |||
261 | if ((phy_data & BMSR_LSTATUS) == 0) { | 261 | if ((phy_data & BMSR_LSTATUS) == 0) { |
262 | /* link down */ | 262 | /* link down */ |
263 | netif_carrier_off(netdev); | 263 | netif_carrier_off(netdev); |
264 | netif_stop_queue(netdev); | ||
265 | hw->hibernate = true; | 264 | hw->hibernate = true; |
266 | if (atl1c_reset_mac(hw) != 0) | 265 | if (atl1c_reset_mac(hw) != 0) |
267 | if (netif_msg_hw(adapter)) | 266 | if (netif_msg_hw(adapter)) |
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c index 46b8b7d81633..d09c6b583d17 100644 --- a/drivers/net/ethernet/broadcom/b44.c +++ b/drivers/net/ethernet/broadcom/b44.c | |||
@@ -656,7 +656,7 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
656 | dma_unmap_single(bp->sdev->dma_dev, mapping, | 656 | dma_unmap_single(bp->sdev->dma_dev, mapping, |
657 | RX_PKT_BUF_SZ, DMA_FROM_DEVICE); | 657 | RX_PKT_BUF_SZ, DMA_FROM_DEVICE); |
658 | dev_kfree_skb_any(skb); | 658 | dev_kfree_skb_any(skb); |
659 | skb = __netdev_alloc_skb(bp->dev, RX_PKT_BUF_SZ, GFP_ATOMIC|GFP_DMA); | 659 | skb = alloc_skb(RX_PKT_BUF_SZ, GFP_ATOMIC | GFP_DMA); |
660 | if (skb == NULL) | 660 | if (skb == NULL) |
661 | return -ENOMEM; | 661 | return -ENOMEM; |
662 | mapping = dma_map_single(bp->sdev->dma_dev, skb->data, | 662 | mapping = dma_map_single(bp->sdev->dma_dev, skb->data, |
@@ -967,7 +967,7 @@ static netdev_tx_t b44_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
967 | dma_unmap_single(bp->sdev->dma_dev, mapping, len, | 967 | dma_unmap_single(bp->sdev->dma_dev, mapping, len, |
968 | DMA_TO_DEVICE); | 968 | DMA_TO_DEVICE); |
969 | 969 | ||
970 | bounce_skb = __netdev_alloc_skb(dev, len, GFP_ATOMIC | GFP_DMA); | 970 | bounce_skb = alloc_skb(len, GFP_ATOMIC | GFP_DMA); |
971 | if (!bounce_skb) | 971 | if (!bounce_skb) |
972 | goto err_out; | 972 | goto err_out; |
973 | 973 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index 1901da153312..0ced154129a9 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c | |||
@@ -5377,7 +5377,7 @@ bnx2_free_tx_skbs(struct bnx2 *bp) | |||
5377 | int k, last; | 5377 | int k, last; |
5378 | 5378 | ||
5379 | if (skb == NULL) { | 5379 | if (skb == NULL) { |
5380 | j++; | 5380 | j = NEXT_TX_BD(j); |
5381 | continue; | 5381 | continue; |
5382 | } | 5382 | } |
5383 | 5383 | ||
@@ -5389,8 +5389,8 @@ bnx2_free_tx_skbs(struct bnx2 *bp) | |||
5389 | tx_buf->skb = NULL; | 5389 | tx_buf->skb = NULL; |
5390 | 5390 | ||
5391 | last = tx_buf->nr_frags; | 5391 | last = tx_buf->nr_frags; |
5392 | j++; | 5392 | j = NEXT_TX_BD(j); |
5393 | for (k = 0; k < last; k++, j++) { | 5393 | for (k = 0; k < last; k++, j = NEXT_TX_BD(j)) { |
5394 | tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)]; | 5394 | tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)]; |
5395 | dma_unmap_page(&bp->pdev->dev, | 5395 | dma_unmap_page(&bp->pdev->dev, |
5396 | dma_unmap_addr(tx_buf, mapping), | 5396 | dma_unmap_addr(tx_buf, mapping), |
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index 650c545705f3..3b4fc61f24cf 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c | |||
@@ -542,7 +542,8 @@ int cnic_unregister_driver(int ulp_type) | |||
542 | } | 542 | } |
543 | 543 | ||
544 | if (atomic_read(&ulp_ops->ref_count) != 0) | 544 | if (atomic_read(&ulp_ops->ref_count) != 0) |
545 | netdev_warn(dev->netdev, "Failed waiting for ref count to go to zero\n"); | 545 | pr_warn("%s: Failed waiting for ref count to go to zero\n", |
546 | __func__); | ||
546 | return 0; | 547 | return 0; |
547 | 548 | ||
548 | out_unlock: | 549 | out_unlock: |
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index af16f9fbc353..4605f7246687 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
@@ -2077,10 +2077,9 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2077 | return NETDEV_TX_OK; | 2077 | return NETDEV_TX_OK; |
2078 | } | 2078 | } |
2079 | 2079 | ||
2080 | /* Steal sock reference for processing TX time stamps */ | 2080 | if (skb->sk) |
2081 | swap(skb_new->sk, skb->sk); | 2081 | skb_set_owner_w(skb_new, skb->sk); |
2082 | swap(skb_new->destructor, skb->destructor); | 2082 | consume_skb(skb); |
2083 | kfree_skb(skb); | ||
2084 | skb = skb_new; | 2083 | skb = skb_new; |
2085 | } | 2084 | } |
2086 | 2085 | ||
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 9313f5c84fad..59a3f141feb1 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -6640,6 +6640,11 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc) | |||
6640 | return -EINVAL; | 6640 | return -EINVAL; |
6641 | } | 6641 | } |
6642 | 6642 | ||
6643 | if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) { | ||
6644 | e_err(drv, "Enable failed, SR-IOV enabled\n"); | ||
6645 | return -EINVAL; | ||
6646 | } | ||
6647 | |||
6643 | /* Hardware supports up to 8 traffic classes */ | 6648 | /* Hardware supports up to 8 traffic classes */ |
6644 | if (tc > adapter->dcb_cfg.num_tcs.pg_tcs || | 6649 | if (tc > adapter->dcb_cfg.num_tcs.pg_tcs || |
6645 | (hw->mac.type == ixgbe_mac_82598EB && | 6650 | (hw->mac.type == ixgbe_mac_82598EB && |
diff --git a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c index fb8377da1687..4b785e10f2ed 100644 --- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c +++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c | |||
@@ -51,7 +51,7 @@ static unsigned int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) | |||
51 | desc->des3 = desc->des2 + BUF_SIZE_4KiB; | 51 | desc->des3 = desc->des2 + BUF_SIZE_4KiB; |
52 | priv->hw->desc->prepare_tx_desc(desc, 1, bmax, | 52 | priv->hw->desc->prepare_tx_desc(desc, 1, bmax, |
53 | csum); | 53 | csum); |
54 | 54 | wmb(); | |
55 | entry = (++priv->cur_tx) % txsize; | 55 | entry = (++priv->cur_tx) % txsize; |
56 | desc = priv->dma_tx + entry; | 56 | desc = priv->dma_tx + entry; |
57 | 57 | ||
@@ -59,6 +59,7 @@ static unsigned int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) | |||
59 | len, DMA_TO_DEVICE); | 59 | len, DMA_TO_DEVICE); |
60 | desc->des3 = desc->des2 + BUF_SIZE_4KiB; | 60 | desc->des3 = desc->des2 + BUF_SIZE_4KiB; |
61 | priv->hw->desc->prepare_tx_desc(desc, 0, len, csum); | 61 | priv->hw->desc->prepare_tx_desc(desc, 0, len, csum); |
62 | wmb(); | ||
62 | priv->hw->desc->set_tx_owner(desc); | 63 | priv->hw->desc->set_tx_owner(desc); |
63 | priv->tx_skbuff[entry] = NULL; | 64 | priv->tx_skbuff[entry] = NULL; |
64 | } else { | 65 | } else { |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index ea3bc0963bd7..f6b04c1a3672 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -1334,6 +1334,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1334 | priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion); | 1334 | priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion); |
1335 | wmb(); | 1335 | wmb(); |
1336 | priv->hw->desc->set_tx_owner(desc); | 1336 | priv->hw->desc->set_tx_owner(desc); |
1337 | wmb(); | ||
1337 | } | 1338 | } |
1338 | 1339 | ||
1339 | /* Interrupt on completition only for the latest segment */ | 1340 | /* Interrupt on completition only for the latest segment */ |
@@ -1349,6 +1350,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1349 | 1350 | ||
1350 | /* To avoid raise condition */ | 1351 | /* To avoid raise condition */ |
1351 | priv->hw->desc->set_tx_owner(first); | 1352 | priv->hw->desc->set_tx_owner(first); |
1353 | wmb(); | ||
1352 | 1354 | ||
1353 | priv->cur_tx++; | 1355 | priv->cur_tx++; |
1354 | 1356 | ||
@@ -1412,6 +1414,7 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv) | |||
1412 | } | 1414 | } |
1413 | wmb(); | 1415 | wmb(); |
1414 | priv->hw->desc->set_rx_owner(p + entry); | 1416 | priv->hw->desc->set_rx_owner(p + entry); |
1417 | wmb(); | ||
1415 | } | 1418 | } |
1416 | } | 1419 | } |
1417 | 1420 | ||
diff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c index 39ea0674dcde..5c120189ec86 100644 --- a/drivers/net/phy/mdio-mux.c +++ b/drivers/net/phy/mdio-mux.c | |||
@@ -46,7 +46,13 @@ static int mdio_mux_read(struct mii_bus *bus, int phy_id, int regnum) | |||
46 | struct mdio_mux_parent_bus *pb = cb->parent; | 46 | struct mdio_mux_parent_bus *pb = cb->parent; |
47 | int r; | 47 | int r; |
48 | 48 | ||
49 | mutex_lock(&pb->mii_bus->mdio_lock); | 49 | /* In theory multiple mdio_mux could be stacked, thus creating |
50 | * more than a single level of nesting. But in practice, | ||
51 | * SINGLE_DEPTH_NESTING will cover the vast majority of use | ||
52 | * cases. We use it, instead of trying to handle the general | ||
53 | * case. | ||
54 | */ | ||
55 | mutex_lock_nested(&pb->mii_bus->mdio_lock, SINGLE_DEPTH_NESTING); | ||
50 | r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); | 56 | r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); |
51 | if (r) | 57 | if (r) |
52 | goto out; | 58 | goto out; |
@@ -71,7 +77,7 @@ static int mdio_mux_write(struct mii_bus *bus, int phy_id, | |||
71 | 77 | ||
72 | int r; | 78 | int r; |
73 | 79 | ||
74 | mutex_lock(&pb->mii_bus->mdio_lock); | 80 | mutex_lock_nested(&pb->mii_bus->mdio_lock, SINGLE_DEPTH_NESTING); |
75 | r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); | 81 | r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); |
76 | if (r) | 82 | if (r) |
77 | goto out; | 83 | goto out; |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index b9cc5f703d7d..85c983d52527 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -374,6 +374,15 @@ static const struct driver_info qmi_wwan_force_int1 = { | |||
374 | .data = BIT(1), /* interface whitelist bitmap */ | 374 | .data = BIT(1), /* interface whitelist bitmap */ |
375 | }; | 375 | }; |
376 | 376 | ||
377 | static const struct driver_info qmi_wwan_force_int2 = { | ||
378 | .description = "Qualcomm WWAN/QMI device", | ||
379 | .flags = FLAG_WWAN, | ||
380 | .bind = qmi_wwan_bind_shared, | ||
381 | .unbind = qmi_wwan_unbind, | ||
382 | .manage_power = qmi_wwan_manage_power, | ||
383 | .data = BIT(2), /* interface whitelist bitmap */ | ||
384 | }; | ||
385 | |||
377 | static const struct driver_info qmi_wwan_force_int3 = { | 386 | static const struct driver_info qmi_wwan_force_int3 = { |
378 | .description = "Qualcomm WWAN/QMI device", | 387 | .description = "Qualcomm WWAN/QMI device", |
379 | .flags = FLAG_WWAN, | 388 | .flags = FLAG_WWAN, |
@@ -526,6 +535,15 @@ static const struct usb_device_id products[] = { | |||
526 | .bInterfaceProtocol = 0xff, | 535 | .bInterfaceProtocol = 0xff, |
527 | .driver_info = (unsigned long)&qmi_wwan_force_int4, | 536 | .driver_info = (unsigned long)&qmi_wwan_force_int4, |
528 | }, | 537 | }, |
538 | { /* ZTE MF60 */ | ||
539 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, | ||
540 | .idVendor = 0x19d2, | ||
541 | .idProduct = 0x1402, | ||
542 | .bInterfaceClass = 0xff, | ||
543 | .bInterfaceSubClass = 0xff, | ||
544 | .bInterfaceProtocol = 0xff, | ||
545 | .driver_info = (unsigned long)&qmi_wwan_force_int2, | ||
546 | }, | ||
529 | { /* Sierra Wireless MC77xx in QMI mode */ | 547 | { /* Sierra Wireless MC77xx in QMI mode */ |
530 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, | 548 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, |
531 | .idVendor = 0x1199, | 549 | .idVendor = 0x1199, |
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c index ff50cb4290e4..2d3c6644f82d 100644 --- a/drivers/net/wireless/b43legacy/dma.c +++ b/drivers/net/wireless/b43legacy/dma.c | |||
@@ -1072,7 +1072,7 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring, | |||
1072 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); | 1072 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); |
1073 | /* create a bounce buffer in zone_dma on mapping failure. */ | 1073 | /* create a bounce buffer in zone_dma on mapping failure. */ |
1074 | if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { | 1074 | if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { |
1075 | bounce_skb = __dev_alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA); | 1075 | bounce_skb = alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA); |
1076 | if (!bounce_skb) { | 1076 | if (!bounce_skb) { |
1077 | ring->current_slot = old_top_slot; | 1077 | ring->current_slot = old_top_slot; |
1078 | ring->used_slots = old_used_slots; | 1078 | ring->used_slots = old_used_slots; |
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c index d24eaf89ffb5..34f61a0581a2 100644 --- a/drivers/net/wireless/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/iwlegacy/4965-mac.c | |||
@@ -3405,7 +3405,7 @@ il4965_remove_dynamic_key(struct il_priv *il, | |||
3405 | return 0; | 3405 | return 0; |
3406 | } | 3406 | } |
3407 | 3407 | ||
3408 | if (il->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET) { | 3408 | if (il->stations[sta_id].sta.key.key_flags & STA_KEY_FLG_INVALID) { |
3409 | IL_WARN("Removing wrong key %d 0x%x\n", keyconf->keyidx, | 3409 | IL_WARN("Removing wrong key %d 0x%x\n", keyconf->keyidx, |
3410 | key_flags); | 3410 | key_flags); |
3411 | spin_unlock_irqrestore(&il->sta_lock, flags); | 3411 | spin_unlock_irqrestore(&il->sta_lock, flags); |
@@ -3420,7 +3420,7 @@ il4965_remove_dynamic_key(struct il_priv *il, | |||
3420 | memset(&il->stations[sta_id].sta.key, 0, sizeof(struct il4965_keyinfo)); | 3420 | memset(&il->stations[sta_id].sta.key, 0, sizeof(struct il4965_keyinfo)); |
3421 | il->stations[sta_id].sta.key.key_flags = | 3421 | il->stations[sta_id].sta.key.key_flags = |
3422 | STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID; | 3422 | STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID; |
3423 | il->stations[sta_id].sta.key.key_offset = WEP_INVALID_OFFSET; | 3423 | il->stations[sta_id].sta.key.key_offset = keyconf->hw_key_idx; |
3424 | il->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; | 3424 | il->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; |
3425 | il->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | 3425 | il->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; |
3426 | 3426 | ||
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c index 763c7529921b..0f8a7703eea3 100644 --- a/drivers/net/wireless/iwlegacy/common.c +++ b/drivers/net/wireless/iwlegacy/common.c | |||
@@ -4768,14 +4768,12 @@ il_bg_watchdog(unsigned long data) | |||
4768 | return; | 4768 | return; |
4769 | 4769 | ||
4770 | /* monitor and check for other stuck queues */ | 4770 | /* monitor and check for other stuck queues */ |
4771 | if (il_is_any_associated(il)) { | 4771 | for (cnt = 0; cnt < il->hw_params.max_txq_num; cnt++) { |
4772 | for (cnt = 0; cnt < il->hw_params.max_txq_num; cnt++) { | 4772 | /* skip as we already checked the command queue */ |
4773 | /* skip as we already checked the command queue */ | 4773 | if (cnt == il->cmd_queue) |
4774 | if (cnt == il->cmd_queue) | 4774 | continue; |
4775 | continue; | 4775 | if (il_check_stuck_queue(il, cnt)) |
4776 | if (il_check_stuck_queue(il, cnt)) | 4776 | return; |
4777 | return; | ||
4778 | } | ||
4779 | } | 4777 | } |
4780 | 4778 | ||
4781 | mod_timer(&il->watchdog, | 4779 | mod_timer(&il->watchdog, |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 4b2733af1a0e..3af88b8cfcb7 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -976,6 +976,7 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy, | |||
976 | case NL80211_HIDDEN_SSID_ZERO_CONTENTS: | 976 | case NL80211_HIDDEN_SSID_ZERO_CONTENTS: |
977 | /* firmware doesn't support this type of hidden SSID */ | 977 | /* firmware doesn't support this type of hidden SSID */ |
978 | default: | 978 | default: |
979 | kfree(bss_cfg); | ||
979 | return -EINVAL; | 980 | return -EINVAL; |
980 | } | 981 | } |
981 | 982 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index d357d1ed92f6..74ecc33fdd90 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -436,8 +436,8 @@ void rt2x00usb_kick_queue(struct data_queue *queue) | |||
436 | case QID_RX: | 436 | case QID_RX: |
437 | if (!rt2x00queue_full(queue)) | 437 | if (!rt2x00queue_full(queue)) |
438 | rt2x00queue_for_each_entry(queue, | 438 | rt2x00queue_for_each_entry(queue, |
439 | Q_INDEX_DONE, | ||
440 | Q_INDEX, | 439 | Q_INDEX, |
440 | Q_INDEX_DONE, | ||
441 | NULL, | 441 | NULL, |
442 | rt2x00usb_kick_rx_entry); | 442 | rt2x00usb_kick_rx_entry); |
443 | break; | 443 | break; |
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index a88fb6939387..e1ce1048fe5f 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
@@ -78,7 +78,7 @@ nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) | |||
78 | struct net *net = nf_ct_net(ct); | 78 | struct net *net = nf_ct_net(ct); |
79 | struct nf_conntrack_ecache *e; | 79 | struct nf_conntrack_ecache *e; |
80 | 80 | ||
81 | if (net->ct.nf_conntrack_event_cb == NULL) | 81 | if (!rcu_access_pointer(net->ct.nf_conntrack_event_cb)) |
82 | return; | 82 | return; |
83 | 83 | ||
84 | e = nf_ct_ecache_find(ct); | 84 | e = nf_ct_ecache_find(ct); |
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 6089f0cf23b4..9096bcb08132 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
@@ -403,6 +403,9 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event, | |||
403 | break; | 403 | break; |
404 | 404 | ||
405 | case NETDEV_DOWN: | 405 | case NETDEV_DOWN: |
406 | if (dev->features & NETIF_F_HW_VLAN_FILTER) | ||
407 | vlan_vid_del(dev, 0); | ||
408 | |||
406 | /* Put all VLANs for this dev in the down state too. */ | 409 | /* Put all VLANs for this dev in the down state too. */ |
407 | for (i = 0; i < VLAN_N_VID; i++) { | 410 | for (i = 0; i < VLAN_N_VID; i++) { |
408 | vlandev = vlan_group_get_device(grp, i); | 411 | vlandev = vlan_group_get_device(grp, i); |
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 3483e4035cbe..6705d35b17ce 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c | |||
@@ -1381,6 +1381,7 @@ void batadv_bla_free(struct batadv_priv *bat_priv) | |||
1381 | * @bat_priv: the bat priv with all the soft interface information | 1381 | * @bat_priv: the bat priv with all the soft interface information |
1382 | * @skb: the frame to be checked | 1382 | * @skb: the frame to be checked |
1383 | * @vid: the VLAN ID of the frame | 1383 | * @vid: the VLAN ID of the frame |
1384 | * @is_bcast: the packet came in a broadcast packet type. | ||
1384 | * | 1385 | * |
1385 | * bla_rx avoidance checks if: | 1386 | * bla_rx avoidance checks if: |
1386 | * * we have to race for a claim | 1387 | * * we have to race for a claim |
@@ -1390,7 +1391,8 @@ void batadv_bla_free(struct batadv_priv *bat_priv) | |||
1390 | * returns 1, otherwise it returns 0 and the caller shall further | 1391 | * returns 1, otherwise it returns 0 and the caller shall further |
1391 | * process the skb. | 1392 | * process the skb. |
1392 | */ | 1393 | */ |
1393 | int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid) | 1394 | int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid, |
1395 | bool is_bcast) | ||
1394 | { | 1396 | { |
1395 | struct ethhdr *ethhdr; | 1397 | struct ethhdr *ethhdr; |
1396 | struct batadv_claim search_claim, *claim = NULL; | 1398 | struct batadv_claim search_claim, *claim = NULL; |
@@ -1409,7 +1411,7 @@ int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid) | |||
1409 | 1411 | ||
1410 | if (unlikely(atomic_read(&bat_priv->bla_num_requests))) | 1412 | if (unlikely(atomic_read(&bat_priv->bla_num_requests))) |
1411 | /* don't allow broadcasts while requests are in flight */ | 1413 | /* don't allow broadcasts while requests are in flight */ |
1412 | if (is_multicast_ether_addr(ethhdr->h_dest)) | 1414 | if (is_multicast_ether_addr(ethhdr->h_dest) && is_bcast) |
1413 | goto handled; | 1415 | goto handled; |
1414 | 1416 | ||
1415 | memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN); | 1417 | memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN); |
@@ -1435,8 +1437,13 @@ int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid) | |||
1435 | } | 1437 | } |
1436 | 1438 | ||
1437 | /* if it is a broadcast ... */ | 1439 | /* if it is a broadcast ... */ |
1438 | if (is_multicast_ether_addr(ethhdr->h_dest)) { | 1440 | if (is_multicast_ether_addr(ethhdr->h_dest) && is_bcast) { |
1439 | /* ... drop it. the responsible gateway is in charge. */ | 1441 | /* ... drop it. the responsible gateway is in charge. |
1442 | * | ||
1443 | * We need to check is_bcast because with the gateway | ||
1444 | * feature, broadcasts (like DHCP requests) may be sent | ||
1445 | * using a unicast packet type. | ||
1446 | */ | ||
1440 | goto handled; | 1447 | goto handled; |
1441 | } else { | 1448 | } else { |
1442 | /* seems the client considers us as its best gateway. | 1449 | /* seems the client considers us as its best gateway. |
diff --git a/net/batman-adv/bridge_loop_avoidance.h b/net/batman-adv/bridge_loop_avoidance.h index 08d13cb1e3df..563cfbf94a7f 100644 --- a/net/batman-adv/bridge_loop_avoidance.h +++ b/net/batman-adv/bridge_loop_avoidance.h | |||
@@ -21,7 +21,8 @@ | |||
21 | #define _NET_BATMAN_ADV_BLA_H_ | 21 | #define _NET_BATMAN_ADV_BLA_H_ |
22 | 22 | ||
23 | #ifdef CONFIG_BATMAN_ADV_BLA | 23 | #ifdef CONFIG_BATMAN_ADV_BLA |
24 | int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid); | 24 | int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid, |
25 | bool is_bcast); | ||
25 | int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid); | 26 | int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid); |
26 | int batadv_bla_is_backbone_gw(struct sk_buff *skb, | 27 | int batadv_bla_is_backbone_gw(struct sk_buff *skb, |
27 | struct batadv_orig_node *orig_node, int hdr_size); | 28 | struct batadv_orig_node *orig_node, int hdr_size); |
@@ -40,7 +41,8 @@ void batadv_bla_free(struct batadv_priv *bat_priv); | |||
40 | #else /* ifdef CONFIG_BATMAN_ADV_BLA */ | 41 | #else /* ifdef CONFIG_BATMAN_ADV_BLA */ |
41 | 42 | ||
42 | static inline int batadv_bla_rx(struct batadv_priv *bat_priv, | 43 | static inline int batadv_bla_rx(struct batadv_priv *bat_priv, |
43 | struct sk_buff *skb, short vid) | 44 | struct sk_buff *skb, short vid, |
45 | bool is_bcast) | ||
44 | { | 46 | { |
45 | return 0; | 47 | return 0; |
46 | } | 48 | } |
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 9e4bb61301ec..109ea2aae96c 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c | |||
@@ -267,8 +267,12 @@ void batadv_interface_rx(struct net_device *soft_iface, | |||
267 | struct batadv_priv *bat_priv = netdev_priv(soft_iface); | 267 | struct batadv_priv *bat_priv = netdev_priv(soft_iface); |
268 | struct ethhdr *ethhdr; | 268 | struct ethhdr *ethhdr; |
269 | struct vlan_ethhdr *vhdr; | 269 | struct vlan_ethhdr *vhdr; |
270 | struct batadv_header *batadv_header = (struct batadv_header *)skb->data; | ||
270 | short vid __maybe_unused = -1; | 271 | short vid __maybe_unused = -1; |
271 | __be16 ethertype = __constant_htons(BATADV_ETH_P_BATMAN); | 272 | __be16 ethertype = __constant_htons(BATADV_ETH_P_BATMAN); |
273 | bool is_bcast; | ||
274 | |||
275 | is_bcast = (batadv_header->packet_type == BATADV_BCAST); | ||
272 | 276 | ||
273 | /* check if enough space is available for pulling, and pull */ | 277 | /* check if enough space is available for pulling, and pull */ |
274 | if (!pskb_may_pull(skb, hdr_size)) | 278 | if (!pskb_may_pull(skb, hdr_size)) |
@@ -315,7 +319,7 @@ void batadv_interface_rx(struct net_device *soft_iface, | |||
315 | /* Let the bridge loop avoidance check the packet. If will | 319 | /* Let the bridge loop avoidance check the packet. If will |
316 | * not handle it, we can safely push it up. | 320 | * not handle it, we can safely push it up. |
317 | */ | 321 | */ |
318 | if (batadv_bla_rx(bat_priv, skb, vid)) | 322 | if (batadv_bla_rx(bat_priv, skb, vid, is_bcast)) |
319 | goto out; | 323 | goto out; |
320 | 324 | ||
321 | netif_rx(skb); | 325 | netif_rx(skb); |
diff --git a/net/core/dev.c b/net/core/dev.c index 5ab6f4b37c0c..73e87c7b4377 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2457,8 +2457,12 @@ static void skb_update_prio(struct sk_buff *skb) | |||
2457 | { | 2457 | { |
2458 | struct netprio_map *map = rcu_dereference_bh(skb->dev->priomap); | 2458 | struct netprio_map *map = rcu_dereference_bh(skb->dev->priomap); |
2459 | 2459 | ||
2460 | if ((!skb->priority) && (skb->sk) && map) | 2460 | if (!skb->priority && skb->sk && map) { |
2461 | skb->priority = map->priomap[skb->sk->sk_cgrp_prioidx]; | 2461 | unsigned int prioidx = skb->sk->sk_cgrp_prioidx; |
2462 | |||
2463 | if (prioidx < map->priomap_len) | ||
2464 | skb->priority = map->priomap[prioidx]; | ||
2465 | } | ||
2462 | } | 2466 | } |
2463 | #else | 2467 | #else |
2464 | #define skb_update_prio(skb) | 2468 | #define skb_update_prio(skb) |
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c index 5b8aa2fae48b..3e953eaddbfc 100644 --- a/net/core/netprio_cgroup.c +++ b/net/core/netprio_cgroup.c | |||
@@ -49,8 +49,9 @@ static int get_prioidx(u32 *prio) | |||
49 | return -ENOSPC; | 49 | return -ENOSPC; |
50 | } | 50 | } |
51 | set_bit(prioidx, prioidx_map); | 51 | set_bit(prioidx, prioidx_map); |
52 | if (atomic_read(&max_prioidx) < prioidx) | ||
53 | atomic_set(&max_prioidx, prioidx); | ||
52 | spin_unlock_irqrestore(&prioidx_map_lock, flags); | 54 | spin_unlock_irqrestore(&prioidx_map_lock, flags); |
53 | atomic_set(&max_prioidx, prioidx); | ||
54 | *prio = prioidx; | 55 | *prio = prioidx; |
55 | return 0; | 56 | return 0; |
56 | } | 57 | } |
@@ -141,7 +142,7 @@ static void cgrp_destroy(struct cgroup *cgrp) | |||
141 | rtnl_lock(); | 142 | rtnl_lock(); |
142 | for_each_netdev(&init_net, dev) { | 143 | for_each_netdev(&init_net, dev) { |
143 | map = rtnl_dereference(dev->priomap); | 144 | map = rtnl_dereference(dev->priomap); |
144 | if (map) | 145 | if (map && cs->prioidx < map->priomap_len) |
145 | map->priomap[cs->prioidx] = 0; | 146 | map->priomap[cs->prioidx] = 0; |
146 | } | 147 | } |
147 | rtnl_unlock(); | 148 | rtnl_unlock(); |
@@ -165,7 +166,7 @@ static int read_priomap(struct cgroup *cont, struct cftype *cft, | |||
165 | rcu_read_lock(); | 166 | rcu_read_lock(); |
166 | for_each_netdev_rcu(&init_net, dev) { | 167 | for_each_netdev_rcu(&init_net, dev) { |
167 | map = rcu_dereference(dev->priomap); | 168 | map = rcu_dereference(dev->priomap); |
168 | priority = map ? map->priomap[prioidx] : 0; | 169 | priority = (map && prioidx < map->priomap_len) ? map->priomap[prioidx] : 0; |
169 | cb->fill(cb, dev->name, priority); | 170 | cb->fill(cb, dev->name, priority); |
170 | } | 171 | } |
171 | rcu_read_unlock(); | 172 | rcu_read_unlock(); |
diff --git a/net/ieee802154/dgram.c b/net/ieee802154/dgram.c index 6fbb2ad7bb6d..16705611589a 100644 --- a/net/ieee802154/dgram.c +++ b/net/ieee802154/dgram.c | |||
@@ -230,6 +230,12 @@ static int dgram_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
230 | mtu = dev->mtu; | 230 | mtu = dev->mtu; |
231 | pr_debug("name = %s, mtu = %u\n", dev->name, mtu); | 231 | pr_debug("name = %s, mtu = %u\n", dev->name, mtu); |
232 | 232 | ||
233 | if (size > mtu) { | ||
234 | pr_debug("size = %Zu, mtu = %u\n", size, mtu); | ||
235 | err = -EINVAL; | ||
236 | goto out_dev; | ||
237 | } | ||
238 | |||
233 | hlen = LL_RESERVED_SPACE(dev); | 239 | hlen = LL_RESERVED_SPACE(dev); |
234 | tlen = dev->needed_tailroom; | 240 | tlen = dev->needed_tailroom; |
235 | skb = sock_alloc_send_skb(sk, hlen + tlen + size, | 241 | skb = sock_alloc_send_skb(sk, hlen + tlen + size, |
@@ -258,12 +264,6 @@ static int dgram_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
258 | if (err < 0) | 264 | if (err < 0) |
259 | goto out_skb; | 265 | goto out_skb; |
260 | 266 | ||
261 | if (size > mtu) { | ||
262 | pr_debug("size = %Zu, mtu = %u\n", size, mtu); | ||
263 | err = -EINVAL; | ||
264 | goto out_skb; | ||
265 | } | ||
266 | |||
267 | skb->dev = dev; | 267 | skb->dev = dev; |
268 | skb->sk = sk; | 268 | skb->sk = sk; |
269 | skb->protocol = htons(ETH_P_IEEE802154); | 269 | skb->protocol = htons(ETH_P_IEEE802154); |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index e6fe84a08443..aa69a331f374 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -2152,15 +2152,13 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
2152 | mgmt->sa, status_code); | 2152 | mgmt->sa, status_code); |
2153 | ieee80211_destroy_assoc_data(sdata, false); | 2153 | ieee80211_destroy_assoc_data(sdata, false); |
2154 | } else { | 2154 | } else { |
2155 | sdata_info(sdata, "associated\n"); | ||
2156 | |||
2157 | if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) { | 2155 | if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) { |
2158 | /* oops -- internal error -- send timeout for now */ | 2156 | /* oops -- internal error -- send timeout for now */ |
2159 | ieee80211_destroy_assoc_data(sdata, true); | 2157 | ieee80211_destroy_assoc_data(sdata, false); |
2160 | sta_info_destroy_addr(sdata, mgmt->bssid); | ||
2161 | cfg80211_put_bss(*bss); | 2158 | cfg80211_put_bss(*bss); |
2162 | return RX_MGMT_CFG80211_ASSOC_TIMEOUT; | 2159 | return RX_MGMT_CFG80211_ASSOC_TIMEOUT; |
2163 | } | 2160 | } |
2161 | sdata_info(sdata, "associated\n"); | ||
2164 | 2162 | ||
2165 | /* | 2163 | /* |
2166 | * destroy assoc_data afterwards, as otherwise an idle | 2164 | * destroy assoc_data afterwards, as otherwise an idle |
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 2d1acc6c5445..f9e51ef8dfa2 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c | |||
@@ -809,7 +809,7 @@ minstrel_ht_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp) | |||
809 | max_rates = sband->n_bitrates; | 809 | max_rates = sband->n_bitrates; |
810 | } | 810 | } |
811 | 811 | ||
812 | msp = kzalloc(sizeof(struct minstrel_ht_sta), gfp); | 812 | msp = kzalloc(sizeof(*msp), gfp); |
813 | if (!msp) | 813 | if (!msp) |
814 | return NULL; | 814 | return NULL; |
815 | 815 | ||
diff --git a/net/netfilter/xt_set.c b/net/netfilter/xt_set.c index 035960ec5cb9..c6f7db720d84 100644 --- a/net/netfilter/xt_set.c +++ b/net/netfilter/xt_set.c | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | #include <linux/netfilter/x_tables.h> | 17 | #include <linux/netfilter/x_tables.h> |
18 | #include <linux/netfilter/xt_set.h> | 18 | #include <linux/netfilter/xt_set.h> |
19 | #include <linux/netfilter/ipset/ip_set_timeout.h> | ||
19 | 20 | ||
20 | MODULE_LICENSE("GPL"); | 21 | MODULE_LICENSE("GPL"); |
21 | MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>"); | 22 | MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>"); |
@@ -310,7 +311,8 @@ set_target_v2(struct sk_buff *skb, const struct xt_action_param *par) | |||
310 | info->del_set.flags, 0, UINT_MAX); | 311 | info->del_set.flags, 0, UINT_MAX); |
311 | 312 | ||
312 | /* Normalize to fit into jiffies */ | 313 | /* Normalize to fit into jiffies */ |
313 | if (add_opt.timeout > UINT_MAX/MSEC_PER_SEC) | 314 | if (add_opt.timeout != IPSET_NO_TIMEOUT && |
315 | add_opt.timeout > UINT_MAX/MSEC_PER_SEC) | ||
314 | add_opt.timeout = UINT_MAX/MSEC_PER_SEC; | 316 | add_opt.timeout = UINT_MAX/MSEC_PER_SEC; |
315 | if (info->add_set.index != IPSET_INVALID_ID) | 317 | if (info->add_set.index != IPSET_INVALID_ID) |
316 | ip_set_add(info->add_set.index, skb, par, &add_opt); | 318 | ip_set_add(info->add_set.index, skb, par, &add_opt); |
diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp/sock.c index 2c0b317344b7..05ca5a680071 100644 --- a/net/nfc/llcp/sock.c +++ b/net/nfc/llcp/sock.c | |||
@@ -292,7 +292,7 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *addr, | |||
292 | 292 | ||
293 | pr_debug("%p\n", sk); | 293 | pr_debug("%p\n", sk); |
294 | 294 | ||
295 | if (llcp_sock == NULL) | 295 | if (llcp_sock == NULL || llcp_sock->dev == NULL) |
296 | return -EBADFD; | 296 | return -EBADFD; |
297 | 297 | ||
298 | addr->sa_family = AF_NFC; | 298 | addr->sa_family = AF_NFC; |
diff --git a/net/rxrpc/ar-peer.c b/net/rxrpc/ar-peer.c index 2754f098d436..bebaa43484bc 100644 --- a/net/rxrpc/ar-peer.c +++ b/net/rxrpc/ar-peer.c | |||
@@ -229,7 +229,7 @@ found_UDP_peer: | |||
229 | return peer; | 229 | return peer; |
230 | 230 | ||
231 | new_UDP_peer: | 231 | new_UDP_peer: |
232 | _net("Rx UDP DGRAM from NEW peer %d", peer->debug_id); | 232 | _net("Rx UDP DGRAM from NEW peer"); |
233 | read_unlock_bh(&rxrpc_peer_lock); | 233 | read_unlock_bh(&rxrpc_peer_lock); |
234 | _leave(" = -EBUSY [new]"); | 234 | _leave(" = -EBUSY [new]"); |
235 | return ERR_PTR(-EBUSY); | 235 | return ERR_PTR(-EBUSY); |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index a2a95aabf9c2..c412ad0d0308 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -331,29 +331,22 @@ static psched_time_t packet_len_2_sched_time(unsigned int len, struct netem_sche | |||
331 | return PSCHED_NS2TICKS(ticks); | 331 | return PSCHED_NS2TICKS(ticks); |
332 | } | 332 | } |
333 | 333 | ||
334 | static int tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch) | 334 | static void tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch) |
335 | { | 335 | { |
336 | struct sk_buff_head *list = &sch->q; | 336 | struct sk_buff_head *list = &sch->q; |
337 | psched_time_t tnext = netem_skb_cb(nskb)->time_to_send; | 337 | psched_time_t tnext = netem_skb_cb(nskb)->time_to_send; |
338 | struct sk_buff *skb; | 338 | struct sk_buff *skb = skb_peek_tail(list); |
339 | |||
340 | if (likely(skb_queue_len(list) < sch->limit)) { | ||
341 | skb = skb_peek_tail(list); | ||
342 | /* Optimize for add at tail */ | ||
343 | if (likely(!skb || tnext >= netem_skb_cb(skb)->time_to_send)) | ||
344 | return qdisc_enqueue_tail(nskb, sch); | ||
345 | 339 | ||
346 | skb_queue_reverse_walk(list, skb) { | 340 | /* Optimize for add at tail */ |
347 | if (tnext >= netem_skb_cb(skb)->time_to_send) | 341 | if (likely(!skb || tnext >= netem_skb_cb(skb)->time_to_send)) |
348 | break; | 342 | return __skb_queue_tail(list, nskb); |
349 | } | ||
350 | 343 | ||
351 | __skb_queue_after(list, skb, nskb); | 344 | skb_queue_reverse_walk(list, skb) { |
352 | sch->qstats.backlog += qdisc_pkt_len(nskb); | 345 | if (tnext >= netem_skb_cb(skb)->time_to_send) |
353 | return NET_XMIT_SUCCESS; | 346 | break; |
354 | } | 347 | } |
355 | 348 | ||
356 | return qdisc_reshape_fail(nskb, sch); | 349 | __skb_queue_after(list, skb, nskb); |
357 | } | 350 | } |
358 | 351 | ||
359 | /* | 352 | /* |
@@ -368,7 +361,6 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
368 | /* We don't fill cb now as skb_unshare() may invalidate it */ | 361 | /* We don't fill cb now as skb_unshare() may invalidate it */ |
369 | struct netem_skb_cb *cb; | 362 | struct netem_skb_cb *cb; |
370 | struct sk_buff *skb2; | 363 | struct sk_buff *skb2; |
371 | int ret; | ||
372 | int count = 1; | 364 | int count = 1; |
373 | 365 | ||
374 | /* Random duplication */ | 366 | /* Random duplication */ |
@@ -419,6 +411,11 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
419 | skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8); | 411 | skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8); |
420 | } | 412 | } |
421 | 413 | ||
414 | if (unlikely(skb_queue_len(&sch->q) >= sch->limit)) | ||
415 | return qdisc_reshape_fail(skb, sch); | ||
416 | |||
417 | sch->qstats.backlog += qdisc_pkt_len(skb); | ||
418 | |||
422 | cb = netem_skb_cb(skb); | 419 | cb = netem_skb_cb(skb); |
423 | if (q->gap == 0 || /* not doing reordering */ | 420 | if (q->gap == 0 || /* not doing reordering */ |
424 | q->counter < q->gap - 1 || /* inside last reordering gap */ | 421 | q->counter < q->gap - 1 || /* inside last reordering gap */ |
@@ -450,7 +447,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
450 | 447 | ||
451 | cb->time_to_send = now + delay; | 448 | cb->time_to_send = now + delay; |
452 | ++q->counter; | 449 | ++q->counter; |
453 | ret = tfifo_enqueue(skb, sch); | 450 | tfifo_enqueue(skb, sch); |
454 | } else { | 451 | } else { |
455 | /* | 452 | /* |
456 | * Do re-ordering by putting one out of N packets at the front | 453 | * Do re-ordering by putting one out of N packets at the front |
@@ -460,16 +457,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
460 | q->counter = 0; | 457 | q->counter = 0; |
461 | 458 | ||
462 | __skb_queue_head(&sch->q, skb); | 459 | __skb_queue_head(&sch->q, skb); |
463 | sch->qstats.backlog += qdisc_pkt_len(skb); | ||
464 | sch->qstats.requeues++; | 460 | sch->qstats.requeues++; |
465 | ret = NET_XMIT_SUCCESS; | ||
466 | } | ||
467 | |||
468 | if (ret != NET_XMIT_SUCCESS) { | ||
469 | if (net_xmit_drop_count(ret)) { | ||
470 | sch->qstats.drops++; | ||
471 | return ret; | ||
472 | } | ||
473 | } | 461 | } |
474 | 462 | ||
475 | return NET_XMIT_SUCCESS; | 463 | return NET_XMIT_SUCCESS; |