Skip to content

Commit 8be636d

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: 1) Fix memory leak in xfrm_state code, from Steffen Klassert. 2) Fix races between devlink reload operations and device setup/cleanup, from Jiri Pirko. 3) Null deref in NFC code, from Stephan Gerhold. 4) Refcount fixes in SMC, from Ursula Braun. 5) Memory leak in slcan open error paths, from Jouni Hogander. 6) Fix ETS bandwidth validation in hns3, from Yonglong Liu. 7) Info leak on short USB request answers in ax88172a driver, from Oliver Neukum. 8) Release mem region properly in ep93xx_eth, from Chuhong Yuan. 9) PTP config timestamp flags validation, from Richard Cochran. 10) Dangling pointers after SKB data realloc in seg6, from Andrea Mayer. 11) Missing free_netdev() in gemini driver, from Chuhong Yuan. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (56 commits) ipmr: Fix skb headroom in ipmr_get_route(). net: hns3: cleanup of stray struct hns3_link_mode_mapping net/smc: fix fastopen for non-blocking connect() rds: ib: update WR sizes when bringing up connection net: gemini: add missed free_netdev net: dsa: tag_8021q: Fix dsa_8021q_restore_pvid for an absent pvid seg6: fix skb transport_header after decap_and_validate() seg6: fix srh pointer in get_srh() net: stmmac: Use the correct style for SPDX License Identifier octeontx2-af: Use the correct style for SPDX License Identifier ptp: Extend the test program to check the external time stamp flags. mlx5: Reject requests to enable time stamping on both edges. igb: Reject requests that fail to enable time stamping on both edges. dp83640: Reject requests to enable time stamping on both edges. mv88e6xxx: Reject requests to enable time stamping on both edges. ptp: Introduce strict checking of external time stamp options. renesas: reject unsupported external timestamp flags mlx5: reject unsupported external timestamp flags igb: reject unsupported external timestamp flags dp83640: reject unsupported external timestamp flags ...
2 parents bec8b6e + 7901cd9 commit 8be636d

File tree

62 files changed

+482
-125
lines changed

Some content is hidden

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

62 files changed

+482
-125
lines changed

drivers/net/can/slcan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ static int slcan_open(struct tty_struct *tty)
617617
sl->tty = NULL;
618618
tty->disc_data = NULL;
619619
clear_bit(SLF_INUSE, &sl->flags);
620+
free_netdev(sl->dev);
620621

621622
err_exit:
622623
rtnl_unlock();

drivers/net/dsa/mv88e6xxx/ptp.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,19 @@ static int mv88e6352_ptp_enable_extts(struct mv88e6xxx_chip *chip,
273273
int pin;
274274
int err;
275275

276+
/* Reject requests with unsupported flags */
277+
if (rq->extts.flags & ~(PTP_ENABLE_FEATURE |
278+
PTP_RISING_EDGE |
279+
PTP_FALLING_EDGE |
280+
PTP_STRICT_FLAGS))
281+
return -EOPNOTSUPP;
282+
283+
/* Reject requests to enable time stamping on both edges. */
284+
if ((rq->extts.flags & PTP_STRICT_FLAGS) &&
285+
(rq->extts.flags & PTP_ENABLE_FEATURE) &&
286+
(rq->extts.flags & PTP_EXTTS_EDGES) == PTP_EXTTS_EDGES)
287+
return -EOPNOTSUPP;
288+
276289
pin = ptp_find_pin(chip->ptp_clock, PTP_PF_EXTTS, rq->extts.index);
277290

278291
if (pin < 0)

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6280,6 +6280,10 @@ static int tg3_ptp_enable(struct ptp_clock_info *ptp,
62806280

62816281
switch (rq->type) {
62826282
case PTP_CLK_REQ_PEROUT:
6283+
/* Reject requests with unsupported flags */
6284+
if (rq->perout.flags)
6285+
return -EOPNOTSUPP;
6286+
62836287
if (rq->perout.index != 0)
62846288
return -EINVAL;
62856289

drivers/net/ethernet/cirrus/ep93xx_eth.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ static int ep93xx_eth_remove(struct platform_device *pdev)
763763
{
764764
struct net_device *dev;
765765
struct ep93xx_priv *ep;
766+
struct resource *mem;
766767

767768
dev = platform_get_drvdata(pdev);
768769
if (dev == NULL)
@@ -778,8 +779,8 @@ static int ep93xx_eth_remove(struct platform_device *pdev)
778779
iounmap(ep->base_addr);
779780

780781
if (ep->res != NULL) {
781-
release_resource(ep->res);
782-
kfree(ep->res);
782+
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
783+
release_mem_region(mem->start, resource_size(mem));
783784
}
784785

785786
free_netdev(dev);

drivers/net/ethernet/cortina/gemini.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,6 +2524,7 @@ static int gemini_ethernet_port_remove(struct platform_device *pdev)
25242524
struct gemini_ethernet_port *port = platform_get_drvdata(pdev);
25252525

25262526
gemini_port_remove(port);
2527+
free_netdev(port->netdev);
25272528
return 0;
25282529
}
25292530

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2232,8 +2232,16 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
22322232
err_service_reg:
22332233
free_channel(priv, channel);
22342234
err_alloc_ch:
2235-
if (err == -EPROBE_DEFER)
2235+
if (err == -EPROBE_DEFER) {
2236+
for (i = 0; i < priv->num_channels; i++) {
2237+
channel = priv->channel[i];
2238+
nctx = &channel->nctx;
2239+
dpaa2_io_service_deregister(channel->dpio, nctx, dev);
2240+
free_channel(priv, channel);
2241+
}
2242+
priv->num_channels = 0;
22362243
return err;
2244+
}
22372245

22382246
if (cpumask_empty(&priv->dpio_cpumask)) {
22392247
dev_err(dev, "No cpu with an affine DPIO/DPCON\n");

drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ static const struct hns3_stats hns3_rxq_stats[] = {
7070
#define HNS3_NIC_LB_TEST_TX_CNT_ERR 2
7171
#define HNS3_NIC_LB_TEST_RX_CNT_ERR 3
7272

73-
struct hns3_link_mode_mapping {
74-
u32 hns3_link_mode;
75-
u32 ethtool_link_mode;
76-
};
77-
7873
static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en)
7974
{
8075
struct hnae3_handle *h = hns3_get_handle(ndev);

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static int hclge_ets_validate(struct hclge_dev *hdev, struct ieee_ets *ets,
124124
if (ret)
125125
return ret;
126126

127-
for (i = 0; i < HNAE3_MAX_TC; i++) {
127+
for (i = 0; i < hdev->tc_max; i++) {
128128
switch (ets->tc_tsa[i]) {
129129
case IEEE_8021QAZ_TSA_STRICT:
130130
if (hdev->tm_info.tc_info[i].tc_sch_mode !=
@@ -318,6 +318,7 @@ static int hclge_ieee_setpfc(struct hnae3_handle *h, struct ieee_pfc *pfc)
318318
struct net_device *netdev = h->kinfo.netdev;
319319
struct hclge_dev *hdev = vport->back;
320320
u8 i, j, pfc_map, *prio_tc;
321+
int ret;
321322

322323
if (!(hdev->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) ||
323324
hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE)
@@ -347,7 +348,21 @@ static int hclge_ieee_setpfc(struct hnae3_handle *h, struct ieee_pfc *pfc)
347348

348349
hclge_tm_pfc_info_update(hdev);
349350

350-
return hclge_pause_setup_hw(hdev, false);
351+
ret = hclge_pause_setup_hw(hdev, false);
352+
if (ret)
353+
return ret;
354+
355+
ret = hclge_notify_client(hdev, HNAE3_DOWN_CLIENT);
356+
if (ret)
357+
return ret;
358+
359+
ret = hclge_buffer_alloc(hdev);
360+
if (ret) {
361+
hclge_notify_client(hdev, HNAE3_UP_CLIENT);
362+
return ret;
363+
}
364+
365+
return hclge_notify_client(hdev, HNAE3_UP_CLIENT);
351366
}
352367

353368
/* DCBX configuration */

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6263,11 +6263,23 @@ static int hclge_config_switch_param(struct hclge_dev *hdev, int vfid,
62636263

62646264
func_id = hclge_get_port_number(HOST_PORT, 0, vfid, 0);
62656265
req = (struct hclge_mac_vlan_switch_cmd *)desc.data;
6266+
6267+
/* read current config parameter */
62666268
hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MAC_VLAN_SWITCH_PARAM,
6267-
false);
6269+
true);
62686270
req->roce_sel = HCLGE_MAC_VLAN_NIC_SEL;
62696271
req->func_id = cpu_to_le32(func_id);
6270-
req->switch_param = switch_param;
6272+
6273+
ret = hclge_cmd_send(&hdev->hw, &desc, 1);
6274+
if (ret) {
6275+
dev_err(&hdev->pdev->dev,
6276+
"read mac vlan switch parameter fail, ret = %d\n", ret);
6277+
return ret;
6278+
}
6279+
6280+
/* modify and write new config parameter */
6281+
hclge_cmd_reuse_desc(&desc, false);
6282+
req->switch_param = (req->switch_param & param_mask) | switch_param;
62716283
req->param_mask = param_mask;
62726284

62736285
ret = hclge_cmd_send(&hdev->hw, &desc, 1);

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,19 @@ static int igb_ptp_feature_enable_i210(struct ptp_clock_info *ptp,
521521

522522
switch (rq->type) {
523523
case PTP_CLK_REQ_EXTTS:
524+
/* Reject requests with unsupported flags */
525+
if (rq->extts.flags & ~(PTP_ENABLE_FEATURE |
526+
PTP_RISING_EDGE |
527+
PTP_FALLING_EDGE |
528+
PTP_STRICT_FLAGS))
529+
return -EOPNOTSUPP;
530+
531+
/* Reject requests failing to enable both edges. */
532+
if ((rq->extts.flags & PTP_STRICT_FLAGS) &&
533+
(rq->extts.flags & PTP_ENABLE_FEATURE) &&
534+
(rq->extts.flags & PTP_EXTTS_EDGES) != PTP_EXTTS_EDGES)
535+
return -EOPNOTSUPP;
536+
524537
if (on) {
525538
pin = ptp_find_pin(igb->ptp_clock, PTP_PF_EXTTS,
526539
rq->extts.index);
@@ -551,6 +564,10 @@ static int igb_ptp_feature_enable_i210(struct ptp_clock_info *ptp,
551564
return 0;
552565

553566
case PTP_CLK_REQ_PEROUT:
567+
/* Reject requests with unsupported flags */
568+
if (rq->perout.flags)
569+
return -EOPNOTSUPP;
570+
554571
if (on) {
555572
pin = ptp_find_pin(igb->ptp_clock, PTP_PF_PEROUT,
556573
rq->perout.index);

0 commit comments

Comments
 (0)