Skip to content

Commit

Permalink
net: mscc: ocelot: adjust maxlen on NPI port, not CPU
Browse files Browse the repository at this point in the history
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 <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vladimir Oltean authored and David S. Miller committed Mar 15, 2020
1 parent 746a1ed commit 4a601f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mscc/ocelot.c
Original file line number Diff line number Diff line change
Expand Up @@ -2341,7 +2341,7 @@ void ocelot_configure_cpu(struct ocelot *ocelot, int npi,
else if (injection == OCELOT_TAG_PREFIX_LONG)
sdu += OCELOT_LONG_PREFIX_LEN;

ocelot_port_set_maxlen(ocelot, cpu, sdu);
ocelot_port_set_maxlen(ocelot, npi, sdu);

/* Enable NPI port */
ocelot_write_rix(ocelot,
Expand Down

0 comments on commit 4a601f1

Please sign in to comment.