]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: properly check for the bridge_leave methods in dsa_switch_bridge_leave()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 13 Jul 2021 09:40:21 +0000 (12:40 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Jul 2021 21:47:10 +0000 (14:47 -0700)
commit2d089fdc54c8f74612ba374854481200ce56c046
tree7c8f2457a62341b03ff2ab08f0e14c9292bbd506
parent4b9fc23a1175d6bbedab946edb8f7f025d6c65b6
net: dsa: properly check for the bridge_leave methods in dsa_switch_bridge_leave()

This was not caught because there is no switch driver which implements
the .port_bridge_join but not .port_bridge_leave method, but it should
nonetheless be fixed, as in certain conditions (driver development) it
might lead to NULL pointer dereference.

Fixes: 5d50e729ee33 ("net: dsa: permit cross-chip bridging between all trees in the system")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/switch.c