From: Vladimir Oltean <olteanv@gmail.com>
To: davem@davemloft.net
Cc: horatiu.vultur@microchip.com, alexandre.belloni@bootlin.com,
andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com,
joergen.andreasen@microchip.com, allan.nielsen@microchip.com,
claudiu.manoil@nxp.com, netdev@vger.kernel.org,
UNGLinuxDriver@microchip.com, alexandru.marginean@nxp.com,
xiaoliang.yang_1@nxp.com, yangbo.lu@nxp.com, po.liu@nxp.com
Subject: [PATCH net-next] net: mscc: ocelot: adjust maxlen on NPI port, not CPU
Date: Fri, 13 Mar 2020 15:46:51 +0200 [thread overview]
Message-ID: <20200313134651.5771-1-olteanv@gmail.com> (raw)
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
next reply other threads:[~2020-03-13 13:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-13 13:46 Vladimir Oltean [this message]
2020-03-15 7:17 ` [PATCH net-next] net: mscc: ocelot: adjust maxlen on NPI port, not CPU David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200313134651.5771-1-olteanv@gmail.com \
--to=olteanv@gmail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandru.marginean@nxp.com \
--cc=allan.nielsen@microchip.com \
--cc=andrew@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=horatiu.vultur@microchip.com \
--cc=joergen.andreasen@microchip.com \
--cc=netdev@vger.kernel.org \
--cc=po.liu@nxp.com \
--cc=vivien.didelot@gmail.com \
--cc=xiaoliang.yang_1@nxp.com \
--cc=yangbo.lu@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).