Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Merge networking fixes from David Miller:

1) Revert Johannes Berg's genetlink locking fix, because it causes
regressions.

Johannes and Pravin Shelar are working on fixing things properly.

2) Do not drop ipv6 ICMP messages without a redirected header option,
they are legal. From Duan Jiong.

3) Missing error return propagation in probing of via-ircc driver.
From Alexey Khoroshilov.

4) Do not clear out broadcast/multicast/unicast/WOL bits in r8169 when
initializing, from Peter Wu.

5) realtek phy driver programs wrong interrupt status bit, from
Giuseppe CAVALLARO.

6) Fix statistics regression in AF_PACKET code, from Willem de Bruijn.

7) Bridge code uses wrong bitmap length, from Toshiaki Makita.

8) SFC driver uses wrong indexes to look up MAC filters, from Ben
Hutchings.

9) Don't pass stack buffers into usb control operations in hso driver,
from Daniel Gimpelevich.

10) Multiple ipv6 fragmentation headers in one packet is illegal and
such packets should be dropped, from Hannes Frederic Sowa.

11) When TCP sockets are "repaired" as part of checkpoint/restart, the
timestamp field of SKBs need to be refreshed otherwise RTOs can be
wildly off. From Andrey Vagin.

12) Fix memcpy args (uses 'address of pointer' instead of 'pointer') in
hostp driver. From Dan Carpenter.

13) nl80211hdr_put() doesn't return an ERR_PTR, but some code believes
it does. From Dan Carpenter.

14) Fix regression in wireless SME disconnects, from Johannes Berg.

15) Don't use a stack buffer for DMA in zd1201 USB wireless driver, from
Jussi Kivilinna.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (33 commits)
ipv4: expose IPV4_DEVCONF
ipv6: handle Redirect ICMP Message with no Redirected Header option
be2net: fix disabling TX in be_close()
Revert "genetlink: fix family dump race"
hso: Fix stack corruption on some architectures
hso: Earlier catch of error condition
sfc: Fix lookup of default RX MAC filters when steered using ethtool
bridge: Use the correct bit length for bitmap functions in the VLAN code
packet: restore packet statistics tp_packets to include drops
net: phy: rtl8211: fix interrupt on status link change
r8169: remember WOL preferences on driver load
via-ircc: don't return zero if via_ircc_open() failed
macvtap: Ignore tap features when VNET_HDR is off
macvtap: Correctly set tap features when IFF_VNET_HDR is disabled.
macvtap: simplify usage of tap_features
tcp: set timestamps for restored skb-s
bnx2x: set VF DMAE when first function has 0 supported VFs
bnx2x: Protect against VFs' ndos when SR-IOV is disabled
bnx2x: prevent VF benign attentions
bnx2x: Consider DCBX remote error
...

+282 -175
+2
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
··· 1333 1333 BNX2X_SP_RTNL_VFPF_CHANNEL_DOWN, 1334 1334 BNX2X_SP_RTNL_VFPF_STORM_RX_MODE, 1335 1335 BNX2X_SP_RTNL_HYPERVISOR_VLAN, 1336 + BNX2X_SP_RTNL_TX_STOP, 1337 + BNX2X_SP_RTNL_TX_RESUME, 1336 1338 }; 1337 1339 1338 1340 struct bnx2x_prev_path_list {
+38 -11
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
··· 30 30 #include "bnx2x_dcb.h" 31 31 32 32 /* forward declarations of dcbx related functions */ 33 - static int bnx2x_dcbx_stop_hw_tx(struct bnx2x *bp); 34 33 static void bnx2x_pfc_set_pfc(struct bnx2x *bp); 35 34 static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp); 36 - static int bnx2x_dcbx_resume_hw_tx(struct bnx2x *bp); 37 35 static void bnx2x_dcbx_get_ets_pri_pg_tbl(struct bnx2x *bp, 38 36 u32 *set_configuration_ets_pg, 39 37 u32 *pri_pg_tbl); ··· 423 425 bnx2x_pfc_clear(bp); 424 426 } 425 427 426 - static int bnx2x_dcbx_stop_hw_tx(struct bnx2x *bp) 428 + int bnx2x_dcbx_stop_hw_tx(struct bnx2x *bp) 427 429 { 428 430 struct bnx2x_func_state_params func_params = {NULL}; 431 + int rc; 429 432 430 433 func_params.f_obj = &bp->func_obj; 431 434 func_params.cmd = BNX2X_F_CMD_TX_STOP; 432 435 436 + __set_bit(RAMROD_COMP_WAIT, &func_params.ramrod_flags); 437 + __set_bit(RAMROD_RETRY, &func_params.ramrod_flags); 438 + 433 439 DP(BNX2X_MSG_DCB, "STOP TRAFFIC\n"); 434 - return bnx2x_func_state_change(bp, &func_params); 440 + 441 + rc = bnx2x_func_state_change(bp, &func_params); 442 + if (rc) { 443 + BNX2X_ERR("Unable to hold traffic for HW configuration\n"); 444 + bnx2x_panic(); 445 + } 446 + 447 + return rc; 435 448 } 436 449 437 - static int bnx2x_dcbx_resume_hw_tx(struct bnx2x *bp) 450 + int bnx2x_dcbx_resume_hw_tx(struct bnx2x *bp) 438 451 { 439 452 struct bnx2x_func_state_params func_params = {NULL}; 440 453 struct bnx2x_func_tx_start_params *tx_params = 441 454 &func_params.params.tx_start; 455 + int rc; 442 456 443 457 func_params.f_obj = &bp->func_obj; 444 458 func_params.cmd = BNX2X_F_CMD_TX_START; 445 459 460 + __set_bit(RAMROD_COMP_WAIT, &func_params.ramrod_flags); 461 + __set_bit(RAMROD_RETRY, &func_params.ramrod_flags); 462 + 446 463 bnx2x_dcbx_fw_struct(bp, tx_params); 447 464 448 465 DP(BNX2X_MSG_DCB, "START TRAFFIC\n"); 449 - return bnx2x_func_state_change(bp, &func_params); 466 + 467 + rc = bnx2x_func_state_change(bp, &func_params); 468 + if (rc) { 469 + BNX2X_ERR("Unable to resume traffic after HW configuration\n"); 470 + bnx2x_panic(); 471 + } 472 + 473 + return rc; 450 474 } 451 475 452 476 static void bnx2x_dcbx_2cos_limit_update_ets_config(struct bnx2x *bp) ··· 764 744 if (IS_MF(bp)) 765 745 bnx2x_link_sync_notify(bp); 766 746 767 - bnx2x_dcbx_stop_hw_tx(bp); 747 + set_bit(BNX2X_SP_RTNL_TX_STOP, &bp->sp_rtnl_state); 748 + 749 + schedule_delayed_work(&bp->sp_rtnl_task, 0); 768 750 769 751 return; 770 752 } ··· 779 757 /* ets may affect cmng configuration: reinit it in hw */ 780 758 bnx2x_set_local_cmng(bp); 781 759 782 - bnx2x_dcbx_resume_hw_tx(bp); 760 + set_bit(BNX2X_SP_RTNL_TX_RESUME, &bp->sp_rtnl_state); 761 + 762 + schedule_delayed_work(&bp->sp_rtnl_task, 0); 783 763 784 764 return; 785 765 case BNX2X_DCBX_STATE_TX_RELEASED: ··· 2391 2367 case DCB_FEATCFG_ATTR_PG: 2392 2368 if (bp->dcbx_local_feat.ets.enabled) 2393 2369 *flags |= DCB_FEATCFG_ENABLE; 2394 - if (bp->dcbx_error & DCBX_LOCAL_ETS_ERROR) 2370 + if (bp->dcbx_error & (DCBX_LOCAL_ETS_ERROR | 2371 + DCBX_REMOTE_MIB_ERROR)) 2395 2372 *flags |= DCB_FEATCFG_ERROR; 2396 2373 break; 2397 2374 case DCB_FEATCFG_ATTR_PFC: 2398 2375 if (bp->dcbx_local_feat.pfc.enabled) 2399 2376 *flags |= DCB_FEATCFG_ENABLE; 2400 2377 if (bp->dcbx_error & (DCBX_LOCAL_PFC_ERROR | 2401 - DCBX_LOCAL_PFC_MISMATCH)) 2378 + DCBX_LOCAL_PFC_MISMATCH | 2379 + DCBX_REMOTE_MIB_ERROR)) 2402 2380 *flags |= DCB_FEATCFG_ERROR; 2403 2381 break; 2404 2382 case DCB_FEATCFG_ATTR_APP: 2405 2383 if (bp->dcbx_local_feat.app.enabled) 2406 2384 *flags |= DCB_FEATCFG_ENABLE; 2407 2385 if (bp->dcbx_error & (DCBX_LOCAL_APP_ERROR | 2408 - DCBX_LOCAL_APP_MISMATCH)) 2386 + DCBX_LOCAL_APP_MISMATCH | 2387 + DCBX_REMOTE_MIB_ERROR)) 2409 2388 *flags |= DCB_FEATCFG_ERROR; 2410 2389 break; 2411 2390 default:
+3
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.h
··· 199 199 int bnx2x_dcbnl_update_applist(struct bnx2x *bp, bool delall); 200 200 #endif /* BCM_DCBNL */ 201 201 202 + int bnx2x_dcbx_stop_hw_tx(struct bnx2x *bp); 203 + int bnx2x_dcbx_resume_hw_tx(struct bnx2x *bp); 204 + 202 205 #endif /* BNX2X_DCB_H */
+32 -13
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 2261 2261 bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_BOTH; 2262 2262 } 2263 2263 2264 + static void bnx2x_init_dropless_fc(struct bnx2x *bp) 2265 + { 2266 + u32 pause_enabled = 0; 2267 + 2268 + if (!CHIP_IS_E1(bp) && bp->dropless_fc && bp->link_vars.link_up) { 2269 + if (bp->link_vars.flow_ctrl & BNX2X_FLOW_CTRL_TX) 2270 + pause_enabled = 1; 2271 + 2272 + REG_WR(bp, BAR_USTRORM_INTMEM + 2273 + USTORM_ETH_PAUSE_ENABLED_OFFSET(BP_PORT(bp)), 2274 + pause_enabled); 2275 + } 2276 + 2277 + DP(NETIF_MSG_IFUP | NETIF_MSG_LINK, "dropless_fc is %s\n", 2278 + pause_enabled ? "enabled" : "disabled"); 2279 + } 2280 + 2264 2281 int bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode) 2265 2282 { 2266 2283 int rc, cfx_idx = bnx2x_get_link_cfg_idx(bp); ··· 2311 2294 2312 2295 bnx2x_release_phy_lock(bp); 2313 2296 2297 + bnx2x_init_dropless_fc(bp); 2298 + 2314 2299 bnx2x_calc_fc_adv(bp); 2315 2300 2316 2301 if (bp->link_vars.link_up) { ··· 2333 2314 bnx2x_acquire_phy_lock(bp); 2334 2315 bnx2x_phy_init(&bp->link_params, &bp->link_vars); 2335 2316 bnx2x_release_phy_lock(bp); 2317 + 2318 + bnx2x_init_dropless_fc(bp); 2336 2319 2337 2320 bnx2x_calc_fc_adv(bp); 2338 2321 } else ··· 2577 2556 2578 2557 bnx2x_link_update(&bp->link_params, &bp->link_vars); 2579 2558 2559 + bnx2x_init_dropless_fc(bp); 2560 + 2580 2561 if (bp->link_vars.link_up) { 2581 - 2582 - /* dropless flow control */ 2583 - if (!CHIP_IS_E1(bp) && bp->dropless_fc) { 2584 - int port = BP_PORT(bp); 2585 - u32 pause_enabled = 0; 2586 - 2587 - if (bp->link_vars.flow_ctrl & BNX2X_FLOW_CTRL_TX) 2588 - pause_enabled = 1; 2589 - 2590 - REG_WR(bp, BAR_USTRORM_INTMEM + 2591 - USTORM_ETH_PAUSE_ENABLED_OFFSET(port), 2592 - pause_enabled); 2593 - } 2594 2562 2595 2563 if (bp->link_vars.mac_type != MAC_TYPE_EMAC) { 2596 2564 struct host_port_stats *pstats; ··· 9655 9645 &bp->sp_rtnl_state)) 9656 9646 bnx2x_pf_set_vfs_vlan(bp); 9657 9647 9648 + if (test_and_clear_bit(BNX2X_SP_RTNL_TX_STOP, &bp->sp_rtnl_state)) 9649 + bnx2x_dcbx_stop_hw_tx(bp); 9650 + 9651 + if (test_and_clear_bit(BNX2X_SP_RTNL_TX_RESUME, &bp->sp_rtnl_state)) 9652 + bnx2x_dcbx_resume_hw_tx(bp); 9653 + 9658 9654 /* work which needs rtnl lock not-taken (as it takes the lock itself and 9659 9655 * can be called from other contexts as well) 9660 9656 */ ··· 11162 11146 { 11163 11147 int tmp; 11164 11148 u32 cfg; 11149 + 11150 + if (IS_VF(bp)) 11151 + return 0; 11165 11152 11166 11153 if (IS_MF(bp) && !CHIP_IS_E1x(bp)) { 11167 11154 /* Take function: tmp = func */
+33 -23
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
··· 1747 1747 1748 1748 void bnx2x_iov_init_dmae(struct bnx2x *bp) 1749 1749 { 1750 - DP(BNX2X_MSG_IOV, "SRIOV is %s\n", IS_SRIOV(bp) ? "ON" : "OFF"); 1751 - if (!IS_SRIOV(bp)) 1752 - return; 1753 - 1754 - REG_WR(bp, DMAE_REG_BACKWARD_COMP_EN, 0); 1750 + if (pci_find_ext_capability(bp->pdev, PCI_EXT_CAP_ID_SRIOV)) 1751 + REG_WR(bp, DMAE_REG_BACKWARD_COMP_EN, 0); 1755 1752 } 1756 1753 1757 1754 static int bnx2x_vf_bus(struct bnx2x *bp, int vfid) ··· 3081 3084 pci_disable_sriov(bp->pdev); 3082 3085 } 3083 3086 3084 - static int bnx2x_vf_ndo_sanity(struct bnx2x *bp, int vfidx, 3085 - struct bnx2x_virtf *vf) 3087 + static int bnx2x_vf_ndo_prep(struct bnx2x *bp, int vfidx, 3088 + struct bnx2x_virtf **vf, 3089 + struct pf_vf_bulletin_content **bulletin) 3086 3090 { 3087 3091 if (bp->state != BNX2X_STATE_OPEN) { 3088 3092 BNX2X_ERR("vf ndo called though PF is down\n"); ··· 3101 3103 return -EINVAL; 3102 3104 } 3103 3105 3104 - if (!vf) { 3106 + /* init members */ 3107 + *vf = BP_VF(bp, vfidx); 3108 + *bulletin = BP_VF_BULLETIN(bp, vfidx); 3109 + 3110 + if (!*vf) { 3105 3111 BNX2X_ERR("vf ndo called but vf was null. vfidx was %d\n", 3112 + vfidx); 3113 + return -EINVAL; 3114 + } 3115 + 3116 + if (!*bulletin) { 3117 + BNX2X_ERR("vf ndo called but Bulletin Board struct is null. vfidx was %d\n", 3106 3118 vfidx); 3107 3119 return -EINVAL; 3108 3120 } ··· 3124 3116 struct ifla_vf_info *ivi) 3125 3117 { 3126 3118 struct bnx2x *bp = netdev_priv(dev); 3127 - struct bnx2x_virtf *vf = BP_VF(bp, vfidx); 3128 - struct bnx2x_vlan_mac_obj *mac_obj = &bnx2x_vfq(vf, 0, mac_obj); 3129 - struct bnx2x_vlan_mac_obj *vlan_obj = &bnx2x_vfq(vf, 0, vlan_obj); 3130 - struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vfidx); 3119 + struct bnx2x_virtf *vf = NULL; 3120 + struct pf_vf_bulletin_content *bulletin = NULL; 3121 + struct bnx2x_vlan_mac_obj *mac_obj; 3122 + struct bnx2x_vlan_mac_obj *vlan_obj; 3131 3123 int rc; 3132 3124 3133 - /* sanity */ 3134 - rc = bnx2x_vf_ndo_sanity(bp, vfidx, vf); 3125 + /* sanity and init */ 3126 + rc = bnx2x_vf_ndo_prep(bp, vfidx, &vf, &bulletin); 3135 3127 if (rc) 3136 3128 return rc; 3137 - if (!mac_obj || !vlan_obj || !bulletin) { 3129 + mac_obj = &bnx2x_vfq(vf, 0, mac_obj); 3130 + vlan_obj = &bnx2x_vfq(vf, 0, vlan_obj); 3131 + if (!mac_obj || !vlan_obj) { 3138 3132 BNX2X_ERR("VF partially initialized\n"); 3139 3133 return -EINVAL; 3140 3134 } ··· 3193 3183 { 3194 3184 struct bnx2x *bp = netdev_priv(dev); 3195 3185 int rc, q_logical_state; 3196 - struct bnx2x_virtf *vf = BP_VF(bp, vfidx); 3197 - struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vfidx); 3186 + struct bnx2x_virtf *vf = NULL; 3187 + struct pf_vf_bulletin_content *bulletin = NULL; 3198 3188 3199 - /* sanity */ 3200 - rc = bnx2x_vf_ndo_sanity(bp, vfidx, vf); 3189 + /* sanity and init */ 3190 + rc = bnx2x_vf_ndo_prep(bp, vfidx, &vf, &bulletin); 3201 3191 if (rc) 3202 3192 return rc; 3203 3193 if (!is_valid_ether_addr(mac)) { ··· 3259 3249 { 3260 3250 struct bnx2x *bp = netdev_priv(dev); 3261 3251 int rc, q_logical_state; 3262 - struct bnx2x_virtf *vf = BP_VF(bp, vfidx); 3263 - struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vfidx); 3252 + struct bnx2x_virtf *vf = NULL; 3253 + struct pf_vf_bulletin_content *bulletin = NULL; 3264 3254 3265 - /* sanity */ 3266 - rc = bnx2x_vf_ndo_sanity(bp, vfidx, vf); 3255 + /* sanity and init */ 3256 + rc = bnx2x_vf_ndo_prep(bp, vfidx, &vf, &bulletin); 3267 3257 if (rc) 3268 3258 return rc; 3269 3259
+1 -1
drivers/net/ethernet/emulex/benet/be_main.c
··· 2563 2563 /* Wait for all pending tx completions to arrive so that 2564 2564 * all tx skbs are freed. 2565 2565 */ 2566 - be_tx_compl_clean(adapter); 2567 2566 netif_tx_disable(netdev); 2567 + be_tx_compl_clean(adapter); 2568 2568 2569 2569 be_rx_qs_destroy(adapter); 2570 2570
+1 -1
drivers/net/ethernet/realtek/r8169.c
··· 7088 7088 7089 7089 RTL_W8(Cfg9346, Cfg9346_Unlock); 7090 7090 RTL_W8(Config1, RTL_R8(Config1) | PMEnable); 7091 - RTL_W8(Config5, RTL_R8(Config5) & PMEStatus); 7091 + RTL_W8(Config5, RTL_R8(Config5) & (BWF | MWF | UWF | LanWake | PMEStatus)); 7092 7092 if ((RTL_R8(Config3) & (LinkUp | MagicPacket)) != 0) 7093 7093 tp->features |= RTL_FEATURE_WOL; 7094 7094 if ((RTL_R8(Config5) & (UWF | BWF | MWF)) != 0)
+1 -1
drivers/net/ethernet/sfc/filter.c
··· 675 675 BUILD_BUG_ON(EFX_FILTER_INDEX_UC_DEF != 0); 676 676 BUILD_BUG_ON(EFX_FILTER_INDEX_MC_DEF != 677 677 EFX_FILTER_MC_DEF - EFX_FILTER_UC_DEF); 678 - rep_index = spec->type - EFX_FILTER_INDEX_UC_DEF; 678 + rep_index = spec->type - EFX_FILTER_UC_DEF; 679 679 ins_index = rep_index; 680 680 681 681 spin_lock_bh(&state->lock);
+2 -4
drivers/net/irda/via-ircc.c
··· 210 210 pci_write_config_byte(pcidev,0x42,(bTmp | 0xf0)); 211 211 pci_write_config_byte(pcidev,0x5a,0xc0); 212 212 WriteLPCReg(0x28, 0x70 ); 213 - if (via_ircc_open(pcidev, &info, 0x3076) == 0) 214 - rc=0; 213 + rc = via_ircc_open(pcidev, &info, 0x3076); 215 214 } else 216 215 rc = -ENODEV; //IR not turn on 217 216 } else { //Not VT1211 ··· 248 249 info.irq=FirIRQ; 249 250 info.dma=FirDRQ1; 250 251 info.dma2=FirDRQ0; 251 - if (via_ircc_open(pcidev, &info, 0x3096) == 0) 252 - rc=0; 252 + rc = via_ircc_open(pcidev, &info, 0x3096); 253 253 } else 254 254 rc = -ENODEV; //IR not turn on !!!!! 255 255 }//Not VT1211
+9 -9
drivers/net/macvtap.c
··· 68 68 #define TUN_OFFLOADS (NETIF_F_HW_CSUM | NETIF_F_TSO_ECN | NETIF_F_TSO | \ 69 69 NETIF_F_TSO6 | NETIF_F_UFO) 70 70 #define RX_OFFLOADS (NETIF_F_GRO | NETIF_F_LRO) 71 + #define TAP_FEATURES (NETIF_F_GSO | NETIF_F_SG) 72 + 71 73 /* 72 74 * RCU usage: 73 75 * The macvtap_queue and the macvlan_dev are loosely coupled, the ··· 280 278 { 281 279 struct macvlan_dev *vlan = netdev_priv(dev); 282 280 struct macvtap_queue *q = macvtap_get_queue(dev, skb); 283 - netdev_features_t features; 281 + netdev_features_t features = TAP_FEATURES; 282 + 284 283 if (!q) 285 284 goto drop; 286 285 ··· 290 287 291 288 skb->dev = dev; 292 289 /* Apply the forward feature mask so that we perform segmentation 293 - * according to users wishes. 290 + * according to users wishes. This only works if VNET_HDR is 291 + * enabled. 294 292 */ 295 - features = netif_skb_features(skb) & vlan->tap_features; 293 + if (q->flags & IFF_VNET_HDR) 294 + features |= vlan->tap_features; 296 295 if (netif_needs_gso(skb, features)) { 297 296 struct sk_buff *segs = __skb_gso_segment(skb, features, false); 298 297 ··· 1069 1064 /* tap_features are the same as features on tun/tap and 1070 1065 * reflect user expectations. 1071 1066 */ 1072 - vlan->tap_features = vlan->dev->features & 1073 - (feature_mask | ~TUN_OFFLOADS); 1067 + vlan->tap_features = feature_mask; 1074 1068 vlan->set_features = features; 1075 1069 netdev_update_features(vlan->dev); 1076 1070 ··· 1165 1161 TUN_F_TSO_ECN | TUN_F_UFO)) 1166 1162 return -EINVAL; 1167 1163 1168 - /* TODO: only accept frames with the features that 1169 - got enabled for forwarded frames */ 1170 - if (!(q->flags & IFF_VNET_HDR)) 1171 - return -EINVAL; 1172 1164 rtnl_lock(); 1173 1165 ret = set_offload(q, arg); 1174 1166 rtnl_unlock();
+2 -2
drivers/net/phy/realtek.c
··· 23 23 #define RTL821x_INER_INIT 0x6400 24 24 #define RTL821x_INSR 0x13 25 25 26 - #define RTL8211E_INER_LINK_STAT 0x10 26 + #define RTL8211E_INER_LINK_STATUS 0x400 27 27 28 28 MODULE_DESCRIPTION("Realtek PHY driver"); 29 29 MODULE_AUTHOR("Johnson Leung"); ··· 57 57 58 58 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) 59 59 err = phy_write(phydev, RTL821x_INER, 60 - RTL8211E_INER_LINK_STAT); 60 + RTL8211E_INER_LINK_STATUS); 61 61 else 62 62 err = phy_write(phydev, RTL821x_INER, 0); 63 63
+10 -5
drivers/net/usb/hso.c
··· 2816 2816 static int hso_get_config_data(struct usb_interface *interface) 2817 2817 { 2818 2818 struct usb_device *usbdev = interface_to_usbdev(interface); 2819 - u8 config_data[17]; 2819 + u8 *config_data = kmalloc(17, GFP_KERNEL); 2820 2820 u32 if_num = interface->altsetting->desc.bInterfaceNumber; 2821 2821 s32 result; 2822 2822 2823 + if (!config_data) 2824 + return -ENOMEM; 2823 2825 if (usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0), 2824 2826 0x86, 0xC0, 0, 0, config_data, 17, 2825 2827 USB_CTRL_SET_TIMEOUT) != 0x11) { 2828 + kfree(config_data); 2826 2829 return -EIO; 2827 2830 } 2828 2831 ··· 2876 2873 if (config_data[16] & 0x1) 2877 2874 result |= HSO_INFO_CRC_BUG; 2878 2875 2876 + kfree(config_data); 2879 2877 return result; 2880 2878 } 2881 2879 ··· 2890 2886 struct hso_shared_int *shared_int; 2891 2887 struct hso_device *tmp_dev = NULL; 2892 2888 2889 + if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) { 2890 + dev_err(&interface->dev, "Not our interface\n"); 2891 + return -ENODEV; 2892 + } 2893 + 2893 2894 if_num = interface->altsetting->desc.bInterfaceNumber; 2894 2895 2895 2896 /* Get the interface/port specification from either driver_info or from ··· 2904 2895 else 2905 2896 port_spec = hso_get_config_data(interface); 2906 2897 2907 - if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) { 2908 - dev_err(&interface->dev, "Not our interface\n"); 2909 - return -ENODEV; 2910 - } 2911 2898 /* Check if we need to switch to alt interfaces prior to port 2912 2899 * configuration */ 2913 2900 if (interface->num_altsetting > 1)
+2 -2
drivers/net/wireless/hostap/hostap_ioctl.c
··· 523 523 524 524 data->length = prism2_ap_get_sta_qual(local, addr, qual, IW_MAX_AP, 1); 525 525 526 - memcpy(extra, &addr, sizeof(struct sockaddr) * data->length); 526 + memcpy(extra, addr, sizeof(struct sockaddr) * data->length); 527 527 data->flags = 1; /* has quality information */ 528 - memcpy(extra + sizeof(struct sockaddr) * data->length, &qual, 528 + memcpy(extra + sizeof(struct sockaddr) * data->length, qual, 529 529 sizeof(struct iw_quality) * data->length); 530 530 531 531 kfree(addr);
+4 -1
drivers/net/wireless/iwlwifi/dvm/mac80211.c
··· 1068 1068 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 1069 1069 return; 1070 1070 1071 - if (test_and_clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status)) 1071 + if (!test_and_clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status)) 1072 + return; 1073 + 1074 + if (ctx->vif) 1072 1075 ieee80211_chswitch_done(ctx->vif, is_success); 1073 1076 } 1074 1077
-2
drivers/net/wireless/iwlwifi/iwl-prph.h
··· 97 97 98 98 #define APMG_PCIDEV_STT_VAL_L1_ACT_DIS (0x00000800) 99 99 100 - #define APMG_RTC_INT_STT_RFKILL (0x10000000) 101 - 102 100 /* Device system time */ 103 101 #define DEVICE_SYSTEM_TIME_REG 0xA0206C 104 102
+23 -10
drivers/net/wireless/iwlwifi/mvm/time-event.c
··· 138 138 schedule_work(&mvm->roc_done_wk); 139 139 } 140 140 141 + static bool iwl_mvm_te_check_disconnect(struct iwl_mvm *mvm, 142 + struct ieee80211_vif *vif, 143 + const char *errmsg) 144 + { 145 + if (vif->type != NL80211_IFTYPE_STATION) 146 + return false; 147 + if (vif->bss_conf.assoc && vif->bss_conf.dtim_period) 148 + return false; 149 + if (errmsg) 150 + IWL_ERR(mvm, "%s\n", errmsg); 151 + ieee80211_connection_loss(vif); 152 + return true; 153 + } 154 + 141 155 /* 142 156 * Handles a FW notification for an event that is known to the driver. 143 157 * ··· 177 163 * P2P Device discoveribility, while there are other higher priority 178 164 * events in the system). 179 165 */ 180 - WARN_ONCE(!le32_to_cpu(notif->status), 181 - "Failed to schedule time event\n"); 166 + if (WARN_ONCE(!le32_to_cpu(notif->status), 167 + "Failed to schedule time event\n")) { 168 + if (iwl_mvm_te_check_disconnect(mvm, te_data->vif, NULL)) { 169 + iwl_mvm_te_clear_data(mvm, te_data); 170 + return; 171 + } 172 + } 182 173 183 174 if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_END) { 184 175 IWL_DEBUG_TE(mvm, ··· 199 180 * By now, we should have finished association 200 181 * and know the dtim period. 201 182 */ 202 - if (te_data->vif->type == NL80211_IFTYPE_STATION && 203 - (!te_data->vif->bss_conf.assoc || 204 - !te_data->vif->bss_conf.dtim_period)) { 205 - IWL_ERR(mvm, 206 - "No assocation and the time event is over already...\n"); 207 - ieee80211_connection_loss(te_data->vif); 208 - } 209 - 183 + iwl_mvm_te_check_disconnect(mvm, te_data->vif, 184 + "No assocation and the time event is over already..."); 210 185 iwl_mvm_te_clear_data(mvm, te_data); 211 186 } else if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_START) { 212 187 te_data->running = true;
-8
drivers/net/wireless/iwlwifi/pcie/rx.c
··· 888 888 889 889 iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); 890 890 if (hw_rfkill) { 891 - /* 892 - * Clear the interrupt in APMG if the NIC is going down. 893 - * Note that when the NIC exits RFkill (else branch), we 894 - * can't access prph and the NIC will be reset in 895 - * start_hw anyway. 896 - */ 897 - iwl_write_prph(trans, APMG_RTC_INT_STT_REG, 898 - APMG_RTC_INT_STT_RFKILL); 899 891 set_bit(STATUS_RFKILL, &trans_pcie->status); 900 892 if (test_and_clear_bit(STATUS_HCMD_ACTIVE, 901 893 &trans_pcie->status))
+5 -5
drivers/net/wireless/iwlwifi/pcie/trans.c
··· 1502 1502 spin_lock_init(&trans_pcie->reg_lock); 1503 1503 init_waitqueue_head(&trans_pcie->ucode_write_waitq); 1504 1504 1505 - /* W/A - seems to solve weird behavior. We need to remove this if we 1506 - * don't want to stay in L1 all the time. This wastes a lot of power */ 1507 - pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 | 1508 - PCIE_LINK_STATE_CLKPM); 1509 - 1510 1505 if (pci_enable_device(pdev)) { 1511 1506 err = -ENODEV; 1512 1507 goto out_no_pci; 1513 1508 } 1509 + 1510 + /* W/A - seems to solve weird behavior. We need to remove this if we 1511 + * don't want to stay in L1 all the time. This wastes a lot of power */ 1512 + pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 | 1513 + PCIE_LINK_STATE_CLKPM); 1514 1514 1515 1515 pci_set_master(pdev); 1516 1516
+3 -1
drivers/net/wireless/zd1201.c
··· 98 98 goto exit; 99 99 100 100 err = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), 0x4, 101 - USB_DIR_IN | 0x40, 0,0, &ret, sizeof(ret), ZD1201_FW_TIMEOUT); 101 + USB_DIR_IN | 0x40, 0, 0, buf, sizeof(ret), ZD1201_FW_TIMEOUT); 102 102 if (err < 0) 103 103 goto exit; 104 + 105 + memcpy(&ret, buf, sizeof(ret)); 104 106 105 107 if (ret & 0x80) { 106 108 err = -EIO;
+1 -33
include/linux/inetdevice.h
··· 5 5 6 6 #include <linux/bitmap.h> 7 7 #include <linux/if.h> 8 + #include <linux/ip.h> 8 9 #include <linux/netdevice.h> 9 10 #include <linux/rcupdate.h> 10 11 #include <linux/timer.h> 11 12 #include <linux/sysctl.h> 12 13 #include <linux/rtnetlink.h> 13 - 14 - enum 15 - { 16 - IPV4_DEVCONF_FORWARDING=1, 17 - IPV4_DEVCONF_MC_FORWARDING, 18 - IPV4_DEVCONF_PROXY_ARP, 19 - IPV4_DEVCONF_ACCEPT_REDIRECTS, 20 - IPV4_DEVCONF_SECURE_REDIRECTS, 21 - IPV4_DEVCONF_SEND_REDIRECTS, 22 - IPV4_DEVCONF_SHARED_MEDIA, 23 - IPV4_DEVCONF_RP_FILTER, 24 - IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE, 25 - IPV4_DEVCONF_BOOTP_RELAY, 26 - IPV4_DEVCONF_LOG_MARTIANS, 27 - IPV4_DEVCONF_TAG, 28 - IPV4_DEVCONF_ARPFILTER, 29 - IPV4_DEVCONF_MEDIUM_ID, 30 - IPV4_DEVCONF_NOXFRM, 31 - IPV4_DEVCONF_NOPOLICY, 32 - IPV4_DEVCONF_FORCE_IGMP_VERSION, 33 - IPV4_DEVCONF_ARP_ANNOUNCE, 34 - IPV4_DEVCONF_ARP_IGNORE, 35 - IPV4_DEVCONF_PROMOTE_SECONDARIES, 36 - IPV4_DEVCONF_ARP_ACCEPT, 37 - IPV4_DEVCONF_ARP_NOTIFY, 38 - IPV4_DEVCONF_ACCEPT_LOCAL, 39 - IPV4_DEVCONF_SRC_VMARK, 40 - IPV4_DEVCONF_PROXY_ARP_PVLAN, 41 - IPV4_DEVCONF_ROUTE_LOCALNET, 42 - __IPV4_DEVCONF_MAX 43 - }; 44 - 45 - #define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1) 46 14 47 15 struct ipv4_devconf { 48 16 void *sysctl;
+1
include/linux/ipv6.h
··· 101 101 #define IP6SKB_FORWARDED 2 102 102 #define IP6SKB_REROUTED 4 103 103 #define IP6SKB_ROUTERALERT 8 104 + #define IP6SKB_FRAGMENTED 16 104 105 }; 105 106 106 107 #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb))
+2
include/net/ip6_route.h
··· 135 135 extern void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, 136 136 __be32 mtu); 137 137 extern void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark); 138 + extern void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif, 139 + u32 mark); 138 140 extern void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk); 139 141 140 142 struct netlink_callback;
+34
include/uapi/linux/ip.h
··· 133 133 __u8 reserved; 134 134 }; 135 135 136 + /* index values for the variables in ipv4_devconf */ 137 + enum 138 + { 139 + IPV4_DEVCONF_FORWARDING=1, 140 + IPV4_DEVCONF_MC_FORWARDING, 141 + IPV4_DEVCONF_PROXY_ARP, 142 + IPV4_DEVCONF_ACCEPT_REDIRECTS, 143 + IPV4_DEVCONF_SECURE_REDIRECTS, 144 + IPV4_DEVCONF_SEND_REDIRECTS, 145 + IPV4_DEVCONF_SHARED_MEDIA, 146 + IPV4_DEVCONF_RP_FILTER, 147 + IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE, 148 + IPV4_DEVCONF_BOOTP_RELAY, 149 + IPV4_DEVCONF_LOG_MARTIANS, 150 + IPV4_DEVCONF_TAG, 151 + IPV4_DEVCONF_ARPFILTER, 152 + IPV4_DEVCONF_MEDIUM_ID, 153 + IPV4_DEVCONF_NOXFRM, 154 + IPV4_DEVCONF_NOPOLICY, 155 + IPV4_DEVCONF_FORCE_IGMP_VERSION, 156 + IPV4_DEVCONF_ARP_ANNOUNCE, 157 + IPV4_DEVCONF_ARP_IGNORE, 158 + IPV4_DEVCONF_PROMOTE_SECONDARIES, 159 + IPV4_DEVCONF_ARP_ACCEPT, 160 + IPV4_DEVCONF_ARP_NOTIFY, 161 + IPV4_DEVCONF_ACCEPT_LOCAL, 162 + IPV4_DEVCONF_SRC_VMARK, 163 + IPV4_DEVCONF_PROXY_ARP_PVLAN, 164 + IPV4_DEVCONF_ROUTE_LOCALNET, 165 + __IPV4_DEVCONF_MAX 166 + }; 167 + 168 + #define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1) 169 + 136 170 #endif /* _UAPI_LINUX_IP_H */
+7 -3
net/batman-adv/unicast.c
··· 432 432 433 433 switch (packet_type) { 434 434 case BATADV_UNICAST: 435 - batadv_unicast_prepare_skb(skb, orig_node); 435 + if (!batadv_unicast_prepare_skb(skb, orig_node)) 436 + goto out; 437 + 436 438 header_len = sizeof(struct batadv_unicast_packet); 437 439 break; 438 440 case BATADV_UNICAST_4ADDR: 439 - batadv_unicast_4addr_prepare_skb(bat_priv, skb, orig_node, 440 - packet_subtype); 441 + if (!batadv_unicast_4addr_prepare_skb(bat_priv, skb, orig_node, 442 + packet_subtype)) 443 + goto out; 444 + 441 445 header_len = sizeof(struct batadv_unicast_4addr_packet); 442 446 break; 443 447 default:
+5 -5
net/bridge/br_fdb.c
··· 161 161 if (!pv) 162 162 return; 163 163 164 - for_each_set_bit_from(vid, pv->vlan_bitmap, BR_VLAN_BITMAP_LEN) { 164 + for_each_set_bit_from(vid, pv->vlan_bitmap, VLAN_N_VID) { 165 165 f = __br_fdb_get(br, br->dev->dev_addr, vid); 166 166 if (f && f->is_local && !f->dst) 167 167 fdb_delete(br, f); ··· 730 730 /* VID was specified, so use it. */ 731 731 err = __br_fdb_add(ndm, p, addr, nlh_flags, vid); 732 732 } else { 733 - if (!pv || bitmap_empty(pv->vlan_bitmap, BR_VLAN_BITMAP_LEN)) { 733 + if (!pv || bitmap_empty(pv->vlan_bitmap, VLAN_N_VID)) { 734 734 err = __br_fdb_add(ndm, p, addr, nlh_flags, 0); 735 735 goto out; 736 736 } ··· 739 739 * specify a VLAN. To be nice, add/update entry for every 740 740 * vlan on this port. 741 741 */ 742 - for_each_set_bit(vid, pv->vlan_bitmap, BR_VLAN_BITMAP_LEN) { 742 + for_each_set_bit(vid, pv->vlan_bitmap, VLAN_N_VID) { 743 743 err = __br_fdb_add(ndm, p, addr, nlh_flags, vid); 744 744 if (err) 745 745 goto out; ··· 817 817 818 818 err = __br_fdb_delete(p, addr, vid); 819 819 } else { 820 - if (!pv || bitmap_empty(pv->vlan_bitmap, BR_VLAN_BITMAP_LEN)) { 820 + if (!pv || bitmap_empty(pv->vlan_bitmap, VLAN_N_VID)) { 821 821 err = __br_fdb_delete(p, addr, 0); 822 822 goto out; 823 823 } ··· 827 827 * vlan on this port. 828 828 */ 829 829 err = -ENOENT; 830 - for_each_set_bit(vid, pv->vlan_bitmap, BR_VLAN_BITMAP_LEN) { 830 + for_each_set_bit(vid, pv->vlan_bitmap, VLAN_N_VID) { 831 831 err &= __br_fdb_delete(p, addr, vid); 832 832 } 833 833 }
+2 -2
net/bridge/br_netlink.c
··· 132 132 else 133 133 pv = br_get_vlan_info(br); 134 134 135 - if (!pv || bitmap_empty(pv->vlan_bitmap, BR_VLAN_BITMAP_LEN)) 135 + if (!pv || bitmap_empty(pv->vlan_bitmap, VLAN_N_VID)) 136 136 goto done; 137 137 138 138 af = nla_nest_start(skb, IFLA_AF_SPEC); ··· 140 140 goto nla_put_failure; 141 141 142 142 pvid = br_get_pvid(pv); 143 - for_each_set_bit(vid, pv->vlan_bitmap, BR_VLAN_BITMAP_LEN) { 143 + for_each_set_bit(vid, pv->vlan_bitmap, VLAN_N_VID) { 144 144 vinfo.vid = vid; 145 145 vinfo.flags = 0; 146 146 if (vid == pvid)
+2 -2
net/bridge/br_vlan.c
··· 108 108 109 109 clear_bit(vid, v->vlan_bitmap); 110 110 v->num_vlans--; 111 - if (bitmap_empty(v->vlan_bitmap, BR_VLAN_BITMAP_LEN)) { 111 + if (bitmap_empty(v->vlan_bitmap, VLAN_N_VID)) { 112 112 if (v->port_idx) 113 113 rcu_assign_pointer(v->parent.port->vlan_info, NULL); 114 114 else ··· 122 122 { 123 123 smp_wmb(); 124 124 v->pvid = 0; 125 - bitmap_zero(v->vlan_bitmap, BR_VLAN_BITMAP_LEN); 125 + bitmap_zero(v->vlan_bitmap, VLAN_N_VID); 126 126 if (v->port_idx) 127 127 rcu_assign_pointer(v->parent.port->vlan_info, NULL); 128 128 else
+7
net/ipv4/tcp.c
··· 1121 1121 goto wait_for_memory; 1122 1122 1123 1123 /* 1124 + * All packets are restored as if they have 1125 + * already been sent. 1126 + */ 1127 + if (tp->repair) 1128 + TCP_SKB_CB(skb)->when = tcp_time_stamp; 1129 + 1130 + /* 1124 1131 * Check whether we can use HW checksum. 1125 1132 */ 1126 1133 if (sk->sk_route_caps & NETIF_F_ALL_CSUM)
+4 -6
net/ipv6/addrconf.c
··· 1126 1126 if (ifp->flags & IFA_F_OPTIMISTIC) 1127 1127 addr_flags |= IFA_F_OPTIMISTIC; 1128 1128 1129 - ift = !max_addresses || 1130 - ipv6_count_addresses(idev) < max_addresses ? 1131 - ipv6_add_addr(idev, &addr, NULL, tmp_plen, 1132 - ipv6_addr_scope(&addr), addr_flags, 1133 - tmp_valid_lft, tmp_prefered_lft) : NULL; 1134 - if (IS_ERR_OR_NULL(ift)) { 1129 + ift = ipv6_add_addr(idev, &addr, NULL, tmp_plen, 1130 + ipv6_addr_scope(&addr), addr_flags, 1131 + tmp_valid_lft, tmp_prefered_lft); 1132 + if (IS_ERR(ift)) { 1135 1133 in6_ifa_put(ifp); 1136 1134 in6_dev_put(idev); 1137 1135 pr_info("%s: retry temporary address regeneration\n", __func__);
+3 -1
net/ipv6/ndisc.c
··· 1369 1369 if (!ndisc_parse_options(msg->opt, ndoptlen, &ndopts)) 1370 1370 return; 1371 1371 1372 - if (!ndopts.nd_opts_rh) 1372 + if (!ndopts.nd_opts_rh) { 1373 + ip6_redirect_no_header(skb, dev_net(skb->dev), 0, 0); 1373 1374 return; 1375 + } 1374 1376 1375 1377 hdr = (u8 *)ndopts.nd_opts_rh; 1376 1378 hdr += 8;
+5
net/ipv6/reassembly.c
··· 490 490 ipv6_hdr(head)->payload_len = htons(payload_len); 491 491 ipv6_change_dsfield(ipv6_hdr(head), 0xff, ecn); 492 492 IP6CB(head)->nhoff = nhoff; 493 + IP6CB(head)->flags |= IP6SKB_FRAGMENTED; 493 494 494 495 /* Yes, and fold redundant checksum back. 8) */ 495 496 if (head->ip_summed == CHECKSUM_COMPLETE) ··· 525 524 struct net *net = dev_net(skb_dst(skb)->dev); 526 525 int evicted; 527 526 527 + if (IP6CB(skb)->flags & IP6SKB_FRAGMENTED) 528 + goto fail_hdr; 529 + 528 530 IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMREQDS); 529 531 530 532 /* Jumbo payload inhibits frag. header */ ··· 548 544 ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMOKS); 549 545 550 546 IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb); 547 + IP6CB(skb)->flags |= IP6SKB_FRAGMENTED; 551 548 return 1; 552 549 } 553 550
+21
net/ipv6/route.c
··· 1178 1178 } 1179 1179 EXPORT_SYMBOL_GPL(ip6_redirect); 1180 1180 1181 + void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif, 1182 + u32 mark) 1183 + { 1184 + const struct ipv6hdr *iph = ipv6_hdr(skb); 1185 + const struct rd_msg *msg = (struct rd_msg *)icmp6_hdr(skb); 1186 + struct dst_entry *dst; 1187 + struct flowi6 fl6; 1188 + 1189 + memset(&fl6, 0, sizeof(fl6)); 1190 + fl6.flowi6_oif = oif; 1191 + fl6.flowi6_mark = mark; 1192 + fl6.flowi6_flags = 0; 1193 + fl6.daddr = msg->dest; 1194 + fl6.saddr = iph->daddr; 1195 + 1196 + dst = ip6_route_output(net, NULL, &fl6); 1197 + if (!dst->error) 1198 + rt6_do_redirect(dst, NULL, skb); 1199 + dst_release(dst); 1200 + } 1201 + 1181 1202 void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk) 1182 1203 { 1183 1204 ip6_redirect(skb, sock_net(sk), sk->sk_bound_dev_if, sk->sk_mark);
-7
net/netlink/genetlink.c
··· 789 789 struct net *net = sock_net(skb->sk); 790 790 int chains_to_skip = cb->args[0]; 791 791 int fams_to_skip = cb->args[1]; 792 - bool need_locking = chains_to_skip || fams_to_skip; 793 - 794 - if (need_locking) 795 - genl_lock(); 796 792 797 793 for (i = chains_to_skip; i < GENL_FAM_TAB_SIZE; i++) { 798 794 n = 0; ··· 809 813 errout: 810 814 cb->args[0] = i; 811 815 cb->args[1] = n; 812 - 813 - if (need_locking) 814 - genl_unlock(); 815 816 816 817 return skb->len; 817 818 }
+2
net/packet/af_packet.c
··· 3259 3259 3260 3260 if (po->tp_version == TPACKET_V3) { 3261 3261 lv = sizeof(struct tpacket_stats_v3); 3262 + st.stats3.tp_packets += st.stats3.tp_drops; 3262 3263 data = &st.stats3; 3263 3264 } else { 3264 3265 lv = sizeof(struct tpacket_stats); 3266 + st.stats1.tp_packets += st.stats1.tp_drops; 3265 3267 data = &st.stats1; 3266 3268 } 3267 3269
+11 -11
net/wireless/nl80211.c
··· 2622 2622 2623 2623 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, 2624 2624 NL80211_CMD_NEW_KEY); 2625 - if (IS_ERR(hdr)) 2626 - return PTR_ERR(hdr); 2625 + if (!hdr) 2626 + return -ENOBUFS; 2627 2627 2628 2628 cookie.msg = msg; 2629 2629 cookie.idx = key_idx; ··· 6507 6507 NL80211_CMD_TESTMODE); 6508 6508 struct nlattr *tmdata; 6509 6509 6510 + if (!hdr) 6511 + break; 6512 + 6510 6513 if (nla_put_u32(skb, NL80211_ATTR_WIPHY, phy_idx)) { 6511 6514 genlmsg_cancel(skb, hdr); 6512 6515 break; ··· 6954 6951 6955 6952 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, 6956 6953 NL80211_CMD_REMAIN_ON_CHANNEL); 6957 - 6958 - if (IS_ERR(hdr)) { 6959 - err = PTR_ERR(hdr); 6954 + if (!hdr) { 6955 + err = -ENOBUFS; 6960 6956 goto free_msg; 6961 6957 } 6962 6958 ··· 7253 7251 7254 7252 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, 7255 7253 NL80211_CMD_FRAME); 7256 - 7257 - if (IS_ERR(hdr)) { 7258 - err = PTR_ERR(hdr); 7254 + if (!hdr) { 7255 + err = -ENOBUFS; 7259 7256 goto free_msg; 7260 7257 } 7261 7258 } ··· 8133 8132 8134 8133 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, 8135 8134 NL80211_CMD_PROBE_CLIENT); 8136 - 8137 - if (IS_ERR(hdr)) { 8138 - err = PTR_ERR(hdr); 8135 + if (!hdr) { 8136 + err = -ENOBUFS; 8139 8137 goto free_msg; 8140 8138 } 8141 8139
+4 -6
net/wireless/sme.c
··· 976 976 struct net_device *dev, u16 reason, bool wextev) 977 977 { 978 978 struct wireless_dev *wdev = dev->ieee80211_ptr; 979 - int err; 979 + int err = 0; 980 980 981 981 ASSERT_WDEV_LOCK(wdev); 982 982 983 983 kfree(wdev->connect_keys); 984 984 wdev->connect_keys = NULL; 985 985 986 - if (wdev->conn) { 986 + if (wdev->conn) 987 987 err = cfg80211_sme_disconnect(wdev, reason); 988 - } else if (!rdev->ops->disconnect) { 988 + else if (!rdev->ops->disconnect) 989 989 cfg80211_mlme_down(rdev, dev); 990 - err = 0; 991 - } else { 990 + else if (wdev->current_bss) 992 991 err = rdev_disconnect(rdev, dev, reason); 993 - } 994 992 995 993 return err; 996 994 }