Skip to contentSkip to conversation

net: mscc: ocelot: adjust maxlen on NPI port, not CPU

PATCH Applied Vladimir Oltean 2 participants 2 messages Mar 13, 2020 – Mar 15, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mscc: ocelot: adjust maxlen on NPI port, not CPU

From: Vladimir Oltean <[email protected]>

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 1d3435793123 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
Fixes a8015ded89ad ("net: mscc: ocelot: properly account for VLAN header length when setting MRU")
---
 drivers/net/ethernet/mscc/ocelot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mscc/ocelot.c +1 -1
index 460dba862d24..38e9210f6099 100644
@@ -2359,7 +2359,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,
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw

From: Vladimir Oltean <[email protected]>
Date: Fri, 13 Mar 2020 15:46:51 +0200

Quoted 7 lines

From: Vladimir Oltean <[email protected]>

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.

Quoted 6 lines

This is a patch for net-next only, the net tree boots fine, the bug was introduced during the net -> net-next merge.

Fixes 1d3435793123 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
Fixes a8015ded89ad ("net: mscc: ocelot: properly account for VLAN header length when setting MRU")

I should have been more careful with this merge conflict. :-)

Applied, thank you.