net: dsa: mv88e6xxx: Fix counting of ATU violations
authorAndrew Lunn <andrew@lunn.ch>
Tue, 5 Feb 2019 23:02:58 +0000 (00:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:47:22 +0000 (19:47 +0100)
commit27a2fa0098171199022affa76bdf15d77585457f
treef1d4df6efa7d9d9db8ca8738e6a726a36d8695be
parentc8dfab5c610f091585d06cf205bd85983cf37ea5
net: dsa: mv88e6xxx: Fix counting of ATU violations

[ Upstream commit 75c05a74e745ae7d663b04d75777af80ada2233c ]

The ATU port vector contains a bit per port of the switch. The code
wrongly used it as a port number, and incremented a port counter. This
resulted in the wrong interfaces counter being incremented, and
potentially going off the end of the array of ports.

Fix this by using the source port ID for the violation, which really
is a port number.

Reported-by: Chris Healy <Chris.Healy@zii.aero>
Tested-by: Chris Healy <Chris.Healy@zii.aero>
Fixes: 65f60e4582bd ("net: dsa: mv88e6xxx: Keep ATU/VTU violation statistics")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/mv88e6xxx/global1_atu.c