Skip to content

Commit 4a601f1

Browse files
vladimirolteandavem330
authored andcommitted
net: mscc: ocelot: adjust maxlen on NPI port, not CPU
Being a non-physical port, the CPU port does not have an ocelot_port structure, so the ocelot_port_writel call inside the ocelot_port_set_maxlen() function would access data behind a NULL pointer. This is a patch for net-next only, the net tree boots fine, the bug was introduced during the net -> net-next merge. Fixes: 1d34357 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net") Fixes: a8015de ("net: mscc: ocelot: properly account for VLAN header length when setting MRU") Signed-off-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 746a1ed commit 4a601f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mscc/ocelot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2341,7 +2341,7 @@ void ocelot_configure_cpu(struct ocelot *ocelot, int npi,
23412341
else if (injection == OCELOT_TAG_PREFIX_LONG)
23422342
sdu += OCELOT_LONG_PREFIX_LEN;
23432343

2344-
ocelot_port_set_maxlen(ocelot, cpu, sdu);
2344+
ocelot_port_set_maxlen(ocelot, npi, sdu);
23452345

23462346
/* Enable NPI port */
23472347
ocelot_write_rix(ocelot,

0 commit comments

Comments
 (0)