Skip to content

Commit caffb99

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: 1) Fix RCU warnings in ipv6 multicast router code, from Madhuparna Bhowmik. 2) Nexthop attributes aren't being checked properly because of mis-initialized iterator, from David Ahern. 3) Revert iop_idents_reserve() change as it caused performance regressions and was just working around what is really a UBSAN bug in the compiler. From Yuqi Jin. 4) Read MAC address properly from ROM in bmac driver (double iteration proceeds past end of address array), from Jeremy Kerr. 5) Add Microsoft Surface device IDs to r8152, from Marc Payne. 6) Prevent reference to freed SKB in __netif_receive_skb_core(), from Boris Sukholitko. 7) Fix ACK discard behavior in rxrpc, from David Howells. 8) Preserve flow hash across packet scrubbing in wireguard, from Jason A. Donenfeld. 9) Cap option length properly for SO_BINDTODEVICE in AX25, from Eric Dumazet. 10) Fix encryption error checking in kTLS code, from Vadim Fedorenko. 11) Missing BPF prog ref release in flow dissector, from Jakub Sitnicki. 12) dst_cache must be used with BH disabled in tipc, from Eric Dumazet. 13) Fix use after free in mlxsw driver, from Jiri Pirko. 14) Order kTLS key destruction properly in mlx5 driver, from Tariq Toukan. 15) Check devm_platform_ioremap_resource() return value properly in several drivers, from Tiezhu Yang. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (71 commits) net: smsc911x: Fix runtime PM imbalance on error net/mlx4_core: fix a memory leak bug. net: ethernet: ti: cpsw: fix ASSERT_RTNL() warning during suspend net: phy: mscc: fix initialization of the MACsec protocol mode net: stmmac: don't attach interface until resume finishes net: Fix return value about devm_platform_ioremap_resource() net/mlx5: Fix error flow in case of function_setup failure net/mlx5e: CT: Correctly get flow rule net/mlx5e: Update netdev txq on completions during closure net/mlx5: Annotate mutex destroy for root ns net/mlx5: Don't maintain a case of del_sw_func being null net/mlx5: Fix cleaning unmanaged flow tables net/mlx5: Fix memory leak in mlx5_events_init net/mlx5e: Fix inner tirs handling net/mlx5e: kTLS, Destroy key object after destroying the TIS net/mlx5e: Fix allowed tc redirect merged eswitch offload cases net/mlx5: Avoid processing commands before cmdif is ready net/mlx5: Fix a race when moving command interface to events mode net/mlx5: Add command entry handling completion rxrpc: Fix a memory leak in rxkad_verify_response() ...
2 parents 0cfc8a8 + 539d39a commit caffb99

File tree

112 files changed

+940
-454
lines changed

Some content is hidden

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

112 files changed

+940
-454
lines changed

Documentation/devicetree/bindings/net/dsa/b53.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ Ethernet switch connected via MDIO to the host, CPU port wired to eth0:
110110
#size-cells = <0>;
111111

112112
ports {
113+
#address-cells = <1>;
114+
#size-cells = <0>;
115+
113116
port0@0 {
114117
reg = <0>;
115118
label = "lan1";

drivers/net/can/ifi_canfd/ifi_canfd.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,11 @@ static int ifi_canfd_plat_probe(struct platform_device *pdev)
947947
u32 id, rev;
948948

949949
addr = devm_platform_ioremap_resource(pdev, 0);
950+
if (IS_ERR(addr))
951+
return PTR_ERR(addr);
952+
950953
irq = platform_get_irq(pdev, 0);
951-
if (IS_ERR(addr) || irq < 0)
954+
if (irq < 0)
952955
return -EINVAL;
953956

954957
id = readl(addr + IFI_CANFD_IP_ID);

drivers/net/can/sun4i_can.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ static int sun4ican_probe(struct platform_device *pdev)
792792

793793
addr = devm_platform_ioremap_resource(pdev, 0);
794794
if (IS_ERR(addr)) {
795-
err = -EBUSY;
795+
err = PTR_ERR(addr);
796796
goto exit;
797797
}
798798

drivers/net/dsa/b53/b53_srab.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ static int b53_srab_probe(struct platform_device *pdev)
609609

610610
priv->regs = devm_platform_ioremap_resource(pdev, 0);
611611
if (IS_ERR(priv->regs))
612-
return -ENOMEM;
612+
return PTR_ERR(priv->regs);
613613

614614
dev = b53_switch_alloc(&pdev->dev, &b53_srab_ops, priv);
615615
if (!dev)

drivers/net/dsa/mt7530.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,8 @@ mt7530_cpu_port_enable(struct mt7530_priv *priv,
628628
mt7530_write(priv, MT7530_PVC_P(port),
629629
PORT_SPEC_TAG);
630630

631-
/* Disable auto learning on the cpu port */
632-
mt7530_set(priv, MT7530_PSC_P(port), SA_DIS);
633-
634-
/* Unknown unicast frame fordwarding to the cpu port */
635-
mt7530_set(priv, MT7530_MFC, UNU_FFP(BIT(port)));
631+
/* Unknown multicast frame forwarding to the cpu port */
632+
mt7530_rmw(priv, MT7530_MFC, UNM_FFP_MASK, UNM_FFP(BIT(port)));
636633

637634
/* Set CPU port number */
638635
if (priv->id == ID_MT7621)
@@ -1294,8 +1291,6 @@ mt7530_setup(struct dsa_switch *ds)
12941291
/* Enable and reset MIB counters */
12951292
mt7530_mib_reset(ds);
12961293

1297-
mt7530_clear(priv, MT7530_MFC, UNU_FFP_MASK);
1298-
12991294
for (i = 0; i < MT7530_NUM_PORTS; i++) {
13001295
/* Disable forwarding by default on all ports */
13011296
mt7530_rmw(priv, MT7530_PCR_P(i), PCR_MATRIX_MASK,

drivers/net/dsa/mt7530.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ enum {
3131
#define MT7530_MFC 0x10
3232
#define BC_FFP(x) (((x) & 0xff) << 24)
3333
#define UNM_FFP(x) (((x) & 0xff) << 16)
34+
#define UNM_FFP_MASK UNM_FFP(~0)
3435
#define UNU_FFP(x) (((x) & 0xff) << 8)
3536
#define UNU_FFP_MASK UNU_FFP(~0)
3637
#define CPU_EN BIT(7)

drivers/net/dsa/ocelot/felix.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports)
388388
struct ocelot *ocelot = &felix->ocelot;
389389
phy_interface_t *port_phy_modes;
390390
resource_size_t switch_base;
391+
struct resource res;
391392
int port, i, err;
392393

393394
ocelot->num_phys_ports = num_phys_ports;
@@ -422,17 +423,16 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports)
422423

423424
for (i = 0; i < TARGET_MAX; i++) {
424425
struct regmap *target;
425-
struct resource *res;
426426

427427
if (!felix->info->target_io_res[i].name)
428428
continue;
429429

430-
res = &felix->info->target_io_res[i];
431-
res->flags = IORESOURCE_MEM;
432-
res->start += switch_base;
433-
res->end += switch_base;
430+
memcpy(&res, &felix->info->target_io_res[i], sizeof(res));
431+
res.flags = IORESOURCE_MEM;
432+
res.start += switch_base;
433+
res.end += switch_base;
434434

435-
target = ocelot_regmap_init(ocelot, res);
435+
target = ocelot_regmap_init(ocelot, &res);
436436
if (IS_ERR(target)) {
437437
dev_err(ocelot->dev,
438438
"Failed to map device memory space\n");
@@ -453,7 +453,6 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports)
453453
for (port = 0; port < num_phys_ports; port++) {
454454
struct ocelot_port *ocelot_port;
455455
void __iomem *port_regs;
456-
struct resource *res;
457456

458457
ocelot_port = devm_kzalloc(ocelot->dev,
459458
sizeof(struct ocelot_port),
@@ -465,12 +464,12 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports)
465464
return -ENOMEM;
466465
}
467466

468-
res = &felix->info->port_io_res[port];
469-
res->flags = IORESOURCE_MEM;
470-
res->start += switch_base;
471-
res->end += switch_base;
467+
memcpy(&res, &felix->info->port_io_res[port], sizeof(res));
468+
res.flags = IORESOURCE_MEM;
469+
res.start += switch_base;
470+
res.end += switch_base;
472471

473-
port_regs = devm_ioremap_resource(ocelot->dev, res);
472+
port_regs = devm_ioremap_resource(ocelot->dev, &res);
474473
if (IS_ERR(port_regs)) {
475474
dev_err(ocelot->dev,
476475
"failed to map registers for port %d\n", port);

drivers/net/dsa/ocelot/felix.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
/* Platform-specific information */
1010
struct felix_info {
11-
struct resource *target_io_res;
12-
struct resource *port_io_res;
13-
struct resource *imdio_res;
11+
const struct resource *target_io_res;
12+
const struct resource *port_io_res;
13+
const struct resource *imdio_res;
1414
const struct reg_field *regfields;
1515
const u32 *const *map;
1616
const struct ocelot_ops *ops;

drivers/net/dsa/ocelot/felix_vsc9959.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,8 @@ static const u32 *vsc9959_regmap[] = {
333333
[GCB] = vsc9959_gcb_regmap,
334334
};
335335

336-
/* Addresses are relative to the PCI device's base address and
337-
* will be fixed up at ioremap time.
338-
*/
339-
static struct resource vsc9959_target_io_res[] = {
336+
/* Addresses are relative to the PCI device's base address */
337+
static const struct resource vsc9959_target_io_res[] = {
340338
[ANA] = {
341339
.start = 0x0280000,
342340
.end = 0x028ffff,
@@ -379,7 +377,7 @@ static struct resource vsc9959_target_io_res[] = {
379377
},
380378
};
381379

382-
static struct resource vsc9959_port_io_res[] = {
380+
static const struct resource vsc9959_port_io_res[] = {
383381
{
384382
.start = 0x0100000,
385383
.end = 0x010ffff,
@@ -415,7 +413,7 @@ static struct resource vsc9959_port_io_res[] = {
415413
/* Port MAC 0 Internal MDIO bus through which the SerDes acting as an
416414
* SGMII/QSGMII MAC PCS can be found.
417415
*/
418-
static struct resource vsc9959_imdio_res = {
416+
static const struct resource vsc9959_imdio_res = {
419417
.start = 0x8030,
420418
.end = 0x8040,
421419
.name = "imdio",
@@ -1111,7 +1109,7 @@ static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot)
11111109
struct device *dev = ocelot->dev;
11121110
resource_size_t imdio_base;
11131111
void __iomem *imdio_regs;
1114-
struct resource *res;
1112+
struct resource res;
11151113
struct enetc_hw *hw;
11161114
struct mii_bus *bus;
11171115
int port;
@@ -1128,12 +1126,12 @@ static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot)
11281126
imdio_base = pci_resource_start(felix->pdev,
11291127
felix->info->imdio_pci_bar);
11301128

1131-
res = felix->info->imdio_res;
1132-
res->flags = IORESOURCE_MEM;
1133-
res->start += imdio_base;
1134-
res->end += imdio_base;
1129+
memcpy(&res, felix->info->imdio_res, sizeof(res));
1130+
res.flags = IORESOURCE_MEM;
1131+
res.start += imdio_base;
1132+
res.end += imdio_base;
11351133

1136-
imdio_regs = devm_ioremap_resource(dev, res);
1134+
imdio_regs = devm_ioremap_resource(dev, &res);
11371135
if (IS_ERR(imdio_regs)) {
11381136
dev_err(dev, "failed to map internal MDIO registers\n");
11391137
return PTR_ERR(imdio_regs);

drivers/net/ethernet/apple/bmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ bmac_get_station_address(struct net_device *dev, unsigned char *ea)
11821182
int i;
11831183
unsigned short data;
11841184

1185-
for (i = 0; i < 6; i++)
1185+
for (i = 0; i < 3; i++)
11861186
{
11871187
reset_and_select_srom(dev);
11881188
data = read_srom(dev, i + EnetAddressOffset/2, SROMAddressBits);

0 commit comments

Comments
 (0)