net: dsa: felix: don't deinitialize unused ports
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 16 Feb 2021 11:14:46 +0000 (13:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:37:34 +0000 (11:37 +0100)
commit100676d5c4d56e993e09958da9f7a74c8a7bbbaf
tree3bfbf21ad7743582015545db026a3281de935e62
parent51b1868b715a8ba92fcfaec723771c44c2fa2145
net: dsa: felix: don't deinitialize unused ports

[ Upstream commit 42b5adbbac03bdb396192316c015fa3e64ffd5a1 ]

ocelot_init_port is called only if dsa_is_unused_port == false, however
ocelot_deinit_port is called unconditionally. This causes a warning in
the skb_queue_purge inside ocelot_deinit_port saying that the spin lock
protecting ocelot_port->tx_skbs was not initialized.

Fixes: e5fb512d81d0 ("net: mscc: ocelot: deinitialize only initialized ports")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/ocelot/felix.c