diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-07-13 12:40:21 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-25 15:36:20 +0300 |
commit | 66c73f187d1ecfd8ac24802f5edbc1f994f9a97c (patch) | |
tree | 7181cd9eeae7fc7f07447007c924189c9b4bbf1d /net/dsa | |
parent | 7d7d0e84ac0d80815abfb7db3ba3e683830b310d (diff) | |
download | linux-66c73f187d1ecfd8ac24802f5edbc1f994f9a97c.tar.xz |
net: dsa: properly check for the bridge_leave methods in dsa_switch_bridge_leave()
commit bcb9928a155444dbd212473e60241ca0a7f641e1 upstream.
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: f66a6a69f97a ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/switch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dsa/switch.c b/net/dsa/switch.c index 3fb362b6874e..a44035872cff 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch.c @@ -112,11 +112,11 @@ static int dsa_switch_bridge_leave(struct dsa_switch *ds, int err, i; if (dst->index == info->tree_index && ds->index == info->sw_index && - ds->ops->port_bridge_join) + ds->ops->port_bridge_leave) ds->ops->port_bridge_leave(ds, info->port, info->br); if ((dst->index != info->tree_index || ds->index != info->sw_index) && - ds->ops->crosschip_bridge_join) + ds->ops->crosschip_bridge_leave) ds->ops->crosschip_bridge_leave(ds, info->tree_index, info->sw_index, info->port, info->br); |