Skip to content

Commit 010b676

Browse files
committed
Merge tag 'net-6.1-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from bluetooth, can and netfilter. Current release - new code bugs: - bonding: ipv6: correct address used in Neighbour Advertisement parsing (src vs dst typo) - fec: properly scope IRQ coalesce setup during link up to supported chips only Previous releases - regressions: - Bluetooth fixes for fake CSR clones (knockoffs): - re-add ERR_DATA_REPORTING quirk - fix crash when device is replugged - Bluetooth: - silence a user-triggerable dmesg error message - L2CAP: fix u8 overflow, oob access - correct vendor codec definition - fix support for Read Local Supported Codecs V2 - ti: am65-cpsw: fix RGMII configuration at SPEED_10 - mana: fix race on per-CQ variable NAPI work_done Previous releases - always broken: - af_unix: diag: fetch user_ns from in_skb in unix_diag_get_exact(), avoid null-deref - af_can: fix NULL pointer dereference in can_rcv_filter - can: slcan: fix UAF with a freed work - can: can327: flush TX_work on ldisc .close() - macsec: add missing attribute validation for offload - ipv6: avoid use-after-free in ip6_fragment() - nft_set_pipapo: actually validate intervals in fields after the first one - mvneta: prevent oob access in mvneta_config_rss() - ipv4: fix incorrect route flushing when table ID 0 is used, or when source address is deleted - phy: mxl-gpy: add workaround for IRQ bug on GPY215B and GPY215C" * tag 'net-6.1-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (77 commits) net: dsa: sja1105: avoid out of bounds access in sja1105_init_l2_policing() s390/qeth: fix use-after-free in hsci macsec: add missing attribute validation for offload net: mvneta: Fix an out of bounds check net: thunderbolt: fix memory leak in tbnet_open() ipv6: avoid use-after-free in ip6_fragment() net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() net: phy: mxl-gpy: add MDINT workaround net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports xen/netback: don't call kfree_skb() under spin_lock_irqsave() dpaa2-switch: Fix memory leak in dpaa2_switch_acl_entry_add() and dpaa2_switch_acl_entry_remove() ethernet: aeroflex: fix potential skb leak in greth_init_rings() tipc: call tipc_lxc_xmit without holding node_read_lock can: esd_usb: Allow REC and TEC to return to zero can: can327: flush TX_work on ldisc .close() can: slcan: fix freed work crash can: af_can: fix NULL pointer dereference in can_rcv_filter net: dsa: sja1105: fix memory leak in sja1105_setup_devlink_regions() ipv4: Fix incorrect route flushing when table ID 0 is used ipv4: Fix incorrect route flushing when source address is deleted ...
2 parents ce19275 + f8bac7f commit 010b676

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+643
-164
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ ForEachMacros:
535535
- 'perf_hpp_list__for_each_sort_list_safe'
536536
- 'perf_pmu__for_each_hybrid_pmu'
537537
- 'ping_portaddr_for_each_entry'
538+
- 'ping_portaddr_for_each_entry_rcu'
538539
- 'plist_for_each'
539540
- 'plist_for_each_continue'
540541
- 'plist_for_each_entry'

drivers/bluetooth/btusb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,6 +2056,11 @@ static int btusb_setup_csr(struct hci_dev *hdev)
20562056

20572057
rp = (struct hci_rp_read_local_version *)skb->data;
20582058

2059+
bt_dev_info(hdev, "CSR: Setting up dongle with HCI ver=%u rev=%04x; LMP ver=%u subver=%04x; manufacturer=%u",
2060+
le16_to_cpu(rp->hci_ver), le16_to_cpu(rp->hci_rev),
2061+
le16_to_cpu(rp->lmp_ver), le16_to_cpu(rp->lmp_subver),
2062+
le16_to_cpu(rp->manufacturer));
2063+
20592064
/* Detect a wide host of Chinese controllers that aren't CSR.
20602065
*
20612066
* Known fake bcdDevices: 0x0100, 0x0134, 0x1915, 0x2520, 0x7558, 0x8891
@@ -2118,6 +2123,7 @@ static int btusb_setup_csr(struct hci_dev *hdev)
21182123
* without these the controller will lock up.
21192124
*/
21202125
set_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks);
2126+
set_bit(HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, &hdev->quirks);
21212127
set_bit(HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL, &hdev->quirks);
21222128
set_bit(HCI_QUIRK_NO_SUSPEND_NOTIFIER, &hdev->quirks);
21232129

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3247,7 +3247,7 @@ static int bond_na_rcv(const struct sk_buff *skb, struct bonding *bond,
32473247
goto out;
32483248

32493249
saddr = &combined->ip6.saddr;
3250-
daddr = &combined->ip6.saddr;
3250+
daddr = &combined->ip6.daddr;
32513251

32523252
slave_dbg(bond->dev, slave->dev, "%s: %s/%d av %d sv %d sip %pI6c tip %pI6c\n",
32533253
__func__, slave->dev->name, bond_slave_state(slave),

drivers/net/can/can327.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,9 @@ static int can327_netdev_close(struct net_device *dev)
796796

797797
netif_stop_queue(dev);
798798

799-
/* Give UART one final chance to flush. */
800-
clear_bit(TTY_DO_WRITE_WAKEUP, &elm->tty->flags);
801-
flush_work(&elm->tx_work);
799+
/* We don't flush the UART TX queue here, as we want final stop
800+
* commands (like the above dummy char) to be flushed out.
801+
*/
802802

803803
can_rx_offload_disable(&elm->offload);
804804
elm->can.state = CAN_STATE_STOPPED;
@@ -1069,12 +1069,15 @@ static void can327_ldisc_close(struct tty_struct *tty)
10691069
{
10701070
struct can327 *elm = (struct can327 *)tty->disc_data;
10711071

1072-
/* unregister_netdev() calls .ndo_stop() so we don't have to.
1073-
* Our .ndo_stop() also flushes the TTY write wakeup handler,
1074-
* so we can safely set elm->tty = NULL after this.
1075-
*/
1072+
/* unregister_netdev() calls .ndo_stop() so we don't have to. */
10761073
unregister_candev(elm->dev);
10771074

1075+
/* Give UART one final chance to flush.
1076+
* No need to clear TTY_DO_WRITE_WAKEUP since .write_wakeup() is
1077+
* serialised against .close() and will not be called once we return.
1078+
*/
1079+
flush_work(&elm->tx_work);
1080+
10781081
/* Mark channel as dead */
10791082
spin_lock_bh(&elm->lock);
10801083
tty->disc_data = NULL;

drivers/net/can/slcan/slcan-core.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,12 +864,14 @@ static void slcan_close(struct tty_struct *tty)
864864
{
865865
struct slcan *sl = (struct slcan *)tty->disc_data;
866866

867-
/* unregister_netdev() calls .ndo_stop() so we don't have to.
868-
* Our .ndo_stop() also flushes the TTY write wakeup handler,
869-
* so we can safely set sl->tty = NULL after this.
870-
*/
871867
unregister_candev(sl->dev);
872868

869+
/*
870+
* The netdev needn't be UP (so .ndo_stop() is not called). Hence make
871+
* sure this is not running before freeing it up.
872+
*/
873+
flush_work(&sl->tx_work);
874+
873875
/* Mark channel as dead */
874876
spin_lock_bh(&sl->lock);
875877
tty->disc_data = NULL;

drivers/net/can/usb/esd_usb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv,
234234
u8 rxerr = msg->msg.rx.data[2];
235235
u8 txerr = msg->msg.rx.data[3];
236236

237+
netdev_dbg(priv->netdev,
238+
"CAN_ERR_EV_EXT: dlc=%#02x state=%02x ecc=%02x rec=%02x tec=%02x\n",
239+
msg->msg.rx.dlc, state, ecc, rxerr, txerr);
240+
237241
skb = alloc_can_err_skb(priv->netdev, &cf);
238242
if (skb == NULL) {
239243
stats->rx_dropped++;
@@ -260,6 +264,8 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv,
260264
break;
261265
default:
262266
priv->can.state = CAN_STATE_ERROR_ACTIVE;
267+
txerr = 0;
268+
rxerr = 0;
263269
break;
264270
}
265271
} else {

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,10 +833,13 @@ static void mv88e6xxx_get_caps(struct dsa_switch *ds, int port,
833833

834834
chip->info->ops->phylink_get_caps(chip, port, config);
835835

836-
/* Internal ports need GMII for PHYLIB */
837-
if (mv88e6xxx_phy_is_internal(ds, port))
836+
if (mv88e6xxx_phy_is_internal(ds, port)) {
837+
__set_bit(PHY_INTERFACE_MODE_INTERNAL,
838+
config->supported_interfaces);
839+
/* Internal ports with no phy-mode need GMII for PHYLIB */
838840
__set_bit(PHY_INTERFACE_MODE_GMII,
839841
config->supported_interfaces);
842+
}
840843
}
841844

842845
static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port,

drivers/net/dsa/sja1105/sja1105_devlink.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ static int sja1105_setup_devlink_regions(struct dsa_switch *ds)
9595
if (IS_ERR(region)) {
9696
while (--i >= 0)
9797
dsa_devlink_region_destroy(priv->regions[i]);
98+
99+
kfree(priv->regions);
98100
return PTR_ERR(region);
99101
}
100102

drivers/net/dsa/sja1105/sja1105_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ static int sja1105_init_l2_policing(struct sja1105_private *priv)
10381038

10391039
policing[bcast].sharindx = port;
10401040
/* Only SJA1110 has multicast policers */
1041-
if (mcast <= table->ops->max_entry_count)
1041+
if (mcast < table->ops->max_entry_count)
10421042
policing[mcast].sharindx = port;
10431043
}
10441044

drivers/net/ethernet/aeroflex/greth.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ static int greth_init_rings(struct greth_private *greth)
258258
if (dma_mapping_error(greth->dev, dma_addr)) {
259259
if (netif_msg_ifup(greth))
260260
dev_err(greth->dev, "Could not create initial DMA mapping\n");
261+
dev_kfree_skb(skb);
261262
goto cleanup;
262263
}
263264
greth->rx_skbuff[i] = skb;

drivers/net/ethernet/broadcom/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,14 @@ config BCM63XX_ENET
7171
config BCMGENET
7272
tristate "Broadcom GENET internal MAC support"
7373
depends on HAS_IOMEM
74+
depends on PTP_1588_CLOCK_OPTIONAL || !ARCH_BCM2835
7475
select MII
7576
select PHYLIB
7677
select FIXED_PHY
7778
select BCM7XXX_PHY
7879
select MDIO_BCM_UNIMAC
7980
select DIMLIB
80-
select BROADCOM_PHY if (ARCH_BCM2835 && PTP_1588_CLOCK_OPTIONAL)
81+
select BROADCOM_PHY if ARCH_BCM2835
8182
help
8283
This driver supports the built-in Ethernet MACs found in the
8384
Broadcom BCM7xxx Set Top Box family chipset.

drivers/net/ethernet/cavium/thunder/nicvf_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2239,7 +2239,7 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
22392239
err = register_netdev(netdev);
22402240
if (err) {
22412241
dev_err(dev, "Failed to register netdevice\n");
2242-
goto err_unregister_interrupts;
2242+
goto err_destroy_workqueue;
22432243
}
22442244

22452245
nic->msg_enable = debug;
@@ -2248,6 +2248,8 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
22482248

22492249
return 0;
22502250

2251+
err_destroy_workqueue:
2252+
destroy_workqueue(nic->nicvf_rx_mode_wq);
22512253
err_unregister_interrupts:
22522254
nicvf_unregister_interrupts(nic);
22532255
err_free_netdev:

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ int dpaa2_switch_acl_entry_add(struct dpaa2_switch_filter_block *filter_block,
132132
DMA_TO_DEVICE);
133133
if (unlikely(dma_mapping_error(dev, acl_entry_cfg->key_iova))) {
134134
dev_err(dev, "DMA mapping failed\n");
135+
kfree(cmd_buff);
135136
return -EFAULT;
136137
}
137138

@@ -142,6 +143,7 @@ int dpaa2_switch_acl_entry_add(struct dpaa2_switch_filter_block *filter_block,
142143
DMA_TO_DEVICE);
143144
if (err) {
144145
dev_err(dev, "dpsw_acl_add_entry() failed %d\n", err);
146+
kfree(cmd_buff);
145147
return err;
146148
}
147149

@@ -172,6 +174,7 @@ dpaa2_switch_acl_entry_remove(struct dpaa2_switch_filter_block *block,
172174
DMA_TO_DEVICE);
173175
if (unlikely(dma_mapping_error(dev, acl_entry_cfg->key_iova))) {
174176
dev_err(dev, "DMA mapping failed\n");
177+
kfree(cmd_buff);
175178
return -EFAULT;
176179
}
177180

@@ -182,6 +185,7 @@ dpaa2_switch_acl_entry_remove(struct dpaa2_switch_filter_block *block,
182185
DMA_TO_DEVICE);
183186
if (err) {
184187
dev_err(dev, "dpsw_acl_remove_entry() failed %d\n", err);
188+
kfree(cmd_buff);
185189
return err;
186190
}
187191

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,8 @@ fec_restart(struct net_device *ndev)
12201220
writel(0, fep->hwp + FEC_IMASK);
12211221

12221222
/* Init the interrupt coalescing */
1223-
fec_enet_itr_coal_set(ndev);
1223+
if (fep->quirks & FEC_QUIRK_HAS_COALESCE)
1224+
fec_enet_itr_coal_set(ndev);
12241225
}
12251226

12261227
static int fec_enet_ipc_handle_init(struct fec_enet_private *fep)

drivers/net/ethernet/hisilicon/hisi_femac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ static int hisi_femac_rx(struct net_device *dev, int limit)
283283
skb->protocol = eth_type_trans(skb, dev);
284284
napi_gro_receive(&priv->napi, skb);
285285
dev->stats.rx_packets++;
286-
dev->stats.rx_bytes += skb->len;
286+
dev->stats.rx_bytes += len;
287287
next:
288288
pos = (pos + 1) % rxq->num;
289289
if (rx_pkts_num >= limit)

drivers/net/ethernet/hisilicon/hix5hd2_gmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ static int hix5hd2_rx(struct net_device *dev, int limit)
550550
skb->protocol = eth_type_trans(skb, dev);
551551
napi_gro_receive(&priv->napi, skb);
552552
dev->stats.rx_packets++;
553-
dev->stats.rx_bytes += skb->len;
553+
dev->stats.rx_bytes += len;
554554
next:
555555
pos = dma_ring_incr(pos, RX_DESC_NUM);
556556
}

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5936,9 +5936,9 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
59365936
e1000_tx_queue(tx_ring, tx_flags, count);
59375937
/* Make sure there is space in the ring for the next send. */
59385938
e1000_maybe_stop_tx(tx_ring,
5939-
(MAX_SKB_FRAGS *
5939+
((MAX_SKB_FRAGS + 1) *
59405940
DIV_ROUND_UP(PAGE_SIZE,
5941-
adapter->tx_fifo_limit) + 2));
5941+
adapter->tx_fifo_limit) + 4));
59425942

59435943
if (!netdev_xmit_more() ||
59445944
netif_xmit_stopped(netdev_get_tx_queue(netdev, 0))) {

drivers/net/ethernet/intel/i40e/i40e_ethtool.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4464,11 +4464,7 @@ static int i40e_check_fdir_input_set(struct i40e_vsi *vsi,
44644464
return -EOPNOTSUPP;
44654465

44664466
/* First 4 bytes of L4 header */
4467-
if (usr_ip4_spec->l4_4_bytes == htonl(0xFFFFFFFF))
4468-
new_mask |= I40E_L4_SRC_MASK | I40E_L4_DST_MASK;
4469-
else if (!usr_ip4_spec->l4_4_bytes)
4470-
new_mask &= ~(I40E_L4_SRC_MASK | I40E_L4_DST_MASK);
4471-
else
4467+
if (usr_ip4_spec->l4_4_bytes)
44724468
return -EOPNOTSUPP;
44734469

44744470
/* Filtering on Type of Service is not supported. */
@@ -4507,11 +4503,7 @@ static int i40e_check_fdir_input_set(struct i40e_vsi *vsi,
45074503
else
45084504
return -EOPNOTSUPP;
45094505

4510-
if (usr_ip6_spec->l4_4_bytes == htonl(0xFFFFFFFF))
4511-
new_mask |= I40E_L4_SRC_MASK | I40E_L4_DST_MASK;
4512-
else if (!usr_ip6_spec->l4_4_bytes)
4513-
new_mask &= ~(I40E_L4_SRC_MASK | I40E_L4_DST_MASK);
4514-
else
4506+
if (usr_ip6_spec->l4_4_bytes)
45154507
return -EOPNOTSUPP;
45164508

45174509
/* Filtering on Traffic class is not supported. */

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10654,6 +10654,21 @@ static int i40e_rebuild_channels(struct i40e_vsi *vsi)
1065410654
return 0;
1065510655
}
1065610656

10657+
/**
10658+
* i40e_clean_xps_state - clean xps state for every tx_ring
10659+
* @vsi: ptr to the VSI
10660+
**/
10661+
static void i40e_clean_xps_state(struct i40e_vsi *vsi)
10662+
{
10663+
int i;
10664+
10665+
if (vsi->tx_rings)
10666+
for (i = 0; i < vsi->num_queue_pairs; i++)
10667+
if (vsi->tx_rings[i])
10668+
clear_bit(__I40E_TX_XPS_INIT_DONE,
10669+
vsi->tx_rings[i]->state);
10670+
}
10671+
1065710672
/**
1065810673
* i40e_prep_for_reset - prep for the core to reset
1065910674
* @pf: board private structure
@@ -10678,8 +10693,10 @@ static void i40e_prep_for_reset(struct i40e_pf *pf)
1067810693
i40e_pf_quiesce_all_vsi(pf);
1067910694

1068010695
for (v = 0; v < pf->num_alloc_vsi; v++) {
10681-
if (pf->vsi[v])
10696+
if (pf->vsi[v]) {
10697+
i40e_clean_xps_state(pf->vsi[v]);
1068210698
pf->vsi[v]->seid = 0;
10699+
}
1068310700
}
1068410701

1068510702
i40e_shutdown_adminq(&pf->hw);

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,7 @@ bool i40e_reset_vf(struct i40e_vf *vf, bool flr)
15781578
i40e_cleanup_reset_vf(vf);
15791579

15801580
i40e_flush(hw);
1581+
usleep_range(20000, 40000);
15811582
clear_bit(I40E_VF_STATE_RESETTING, &vf->vf_states);
15821583

15831584
return true;
@@ -1701,6 +1702,7 @@ bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)
17011702
}
17021703

17031704
i40e_flush(hw);
1705+
usleep_range(20000, 40000);
17041706
clear_bit(__I40E_VF_DISABLE, pf->state);
17051707

17061708
return true;

drivers/net/ethernet/intel/igb/igb_ethtool.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,6 +1413,8 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
14131413
*data = 1;
14141414
return -1;
14151415
}
1416+
wr32(E1000_IVAR_MISC, E1000_IVAR_VALID << 8);
1417+
wr32(E1000_EIMS, BIT(0));
14161418
} else if (adapter->flags & IGB_FLAG_HAS_MSI) {
14171419
shared_int = false;
14181420
if (request_irq(irq,

drivers/net/ethernet/marvell/mvneta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4271,7 +4271,7 @@ static void mvneta_percpu_elect(struct mvneta_port *pp)
42714271
/* Use the cpu associated to the rxq when it is online, in all
42724272
* the other cases, use the cpu 0 which can't be offline.
42734273
*/
4274-
if (cpu_online(pp->rxq_def))
4274+
if (pp->rxq_def < nr_cpu_ids && cpu_online(pp->rxq_def))
42754275
elected_cpu = pp->rxq_def;
42764276

42774277
max_cpu = num_present_cpus();

drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,12 @@ int otx2_init_tc(struct otx2_nic *nic)
11341134
return err;
11351135

11361136
tc->flow_ht_params = tc_flow_ht_params;
1137-
return rhashtable_init(&tc->flow_table, &tc->flow_ht_params);
1137+
err = rhashtable_init(&tc->flow_table, &tc->flow_ht_params);
1138+
if (err) {
1139+
kfree(tc->tc_entries_bitmap);
1140+
tc->tc_entries_bitmap = NULL;
1141+
}
1142+
return err;
11381143
}
11391144
EXPORT_SYMBOL(otx2_init_tc);
11401145

drivers/net/ethernet/microchip/encx24j600-regmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static int regmap_encx24j600_phy_reg_read(void *context, unsigned int reg,
359359
goto err_out;
360360

361361
usleep_range(26, 100);
362-
while ((ret = regmap_read(ctx->regmap, MISTAT, &mistat) != 0) &&
362+
while (((ret = regmap_read(ctx->regmap, MISTAT, &mistat)) == 0) &&
363363
(mistat & BUSY))
364364
cpu_relax();
365365

@@ -397,7 +397,7 @@ static int regmap_encx24j600_phy_reg_write(void *context, unsigned int reg,
397397
goto err_out;
398398

399399
usleep_range(26, 100);
400-
while ((ret = regmap_read(ctx->regmap, MISTAT, &mistat) != 0) &&
400+
while (((ret = regmap_read(ctx->regmap, MISTAT, &mistat)) == 0) &&
401401
(mistat & BUSY))
402402
cpu_relax();
403403

drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ int sparx5_fdma_xmit(struct sparx5 *sparx5, u32 *ifh, struct sk_buff *skb)
317317
next_dcb_hw = sparx5_fdma_next_dcb(tx, tx->curr_entry);
318318
db_hw = &next_dcb_hw->db[0];
319319
if (!(db_hw->status & FDMA_DCB_STATUS_DONE))
320-
tx->dropped++;
320+
return -EINVAL;
321321
db = list_first_entry(&tx->db_list, struct sparx5_db, list);
322322
list_move_tail(&db->list, &tx->db_list);
323323
next_dcb_hw->nextptr = FDMA_DCB_INVALID_DATA;

0 commit comments

Comments
 (0)