]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: adjust maxlen on NPI port, not CPU
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 13 Mar 2020 13:46:51 +0000 (15:46 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Mar 2020 07:16:40 +0000 (00:16 -0700)
commite4d215ecd1353fccfaab3af6ef2ee18168753a36
tree4161ae73272d6a006acb9c53819080191a1dc785
parent2d6e9f8f8c1d5b0dc1a0bf4635a2a86ac7517392
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: 094d728a521f ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
Fixes: e2c28c8da7ff ("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>
drivers/net/ethernet/mscc/ocelot.c