netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: mscc: ocelot: adjust maxlen on NPI port, not CPU
@ 2020-03-13 13:46 Vladimir Oltean
  2020-03-15  7:17 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Oltean @ 2020-03-13 13:46 UTC (permalink / raw)
  To: davem
  Cc: horatiu.vultur, alexandre.belloni, andrew, f.fainelli,
	vivien.didelot, joergen.andreasen, allan.nielsen, claudiu.manoil,
	netdev, UNGLinuxDriver, alexandru.marginean, xiaoliang.yang_1,
	yangbo.lu, po.liu

From: Vladimir Oltean <vladimir.oltean@nxp.com>

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")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/ethernet/mscc/ocelot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index 460dba862d24..38e9210f6099 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -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,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: mscc: ocelot: adjust maxlen on NPI port, not CPU
  2020-03-13 13:46 [PATCH net-next] net: mscc: ocelot: adjust maxlen on NPI port, not CPU Vladimir Oltean
@ 2020-03-15  7:17 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-03-15  7:17 UTC (permalink / raw)
  To: olteanv
  Cc: horatiu.vultur, alexandre.belloni, andrew, f.fainelli,
	vivien.didelot, joergen.andreasen, allan.nielsen, claudiu.manoil,
	netdev, UNGLinuxDriver, alexandru.marginean, xiaoliang.yang_1,
	yangbo.lu, po.liu

From: Vladimir Oltean <olteanv@gmail.com>
Date: Fri, 13 Mar 2020 15:46:51 +0200

> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> 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")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

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

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-15  7:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-13 13:46 [PATCH net-next] net: mscc: ocelot: adjust maxlen on NPI port, not CPU Vladimir Oltean
2020-03-15  7:17 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).