linux/net/dsa
Vladimir Oltean 09dba21b43 net: dsa: don't call switchdev_bridge_port_unoffload for unoffloaded bridge ports
For ports that have a NULL dp->bridge_dev, dsa_port_to_bridge_port()
also returns NULL as expected.

Issue #1 is that we are performing a NULL pointer dereference on brport_dev.

Issue #2 is that these are ports on which switchdev_bridge_port_offload
has not been called, so we should not call switchdev_bridge_port_unoffload
on them either.

Both issues are addressed by checking against a NULL brport_dev in
dsa_port_pre_bridge_leave and exiting early.

Fixes: 2f5dc00f7a ("net: bridge: switchdev: let drivers inform which bridge ports are offloaded")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-08-24 09:30:58 +01:00
..
dsa2.c net: dsa: track unique bridge numbers across all DSA switch trees 2021-08-23 11:52:31 +01:00
dsa_priv.h net: dsa: track unique bridge numbers across all DSA switch trees 2021-08-23 11:52:31 +01:00
dsa.c net: dsa: remove the struct packet_type argument from dsa_device_ops::rcv() 2021-08-02 15:13:15 +01:00
Kconfig net: dsa: tag_sja1105: be dsa_loop-safe 2021-08-18 10:33:15 +01:00
Makefile net: dsa: build tag_8021q.c as part of DSA core 2021-07-20 06:36:42 -07:00
master.c dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
port.c net: dsa: don't call switchdev_bridge_port_unoffload for unoffloaded bridge ports 2021-08-24 09:30:58 +01:00
slave.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-13 06:41:22 -07:00
switch.c net: dsa: tag_8021q: add proper cross-chip notifier support 2021-07-20 06:36:42 -07:00
tag_8021q.c net: dsa: tag_8021q: fix notifiers broadcast when they shouldn't, and vice versa 2021-08-16 11:14:18 +01:00
tag_ar9331.c net: dsa: remove the struct packet_type argument from dsa_device_ops::rcv() 2021-08-02 15:13:15 +01:00
tag_brcm.c net: dsa: create a helper for locating EtherType DSA headers on RX 2021-08-11 14:44:58 +01:00
tag_dsa.c net: dsa: create a helper for locating EtherType DSA headers on TX 2021-08-11 14:44:58 +01:00
tag_gswip.c net: dsa: remove the struct packet_type argument from dsa_device_ops::rcv() 2021-08-02 15:13:15 +01:00
tag_hellcreek.c net: dsa: remove the struct packet_type argument from dsa_device_ops::rcv() 2021-08-02 15:13:15 +01:00
tag_ksz.c net: dsa: remove the struct packet_type argument from dsa_device_ops::rcv() 2021-08-02 15:13:15 +01:00
tag_lan9303.c net: dsa: create a helper for locating EtherType DSA headers on TX 2021-08-11 14:44:58 +01:00
tag_mtk.c net: dsa: create a helper for locating EtherType DSA headers on TX 2021-08-11 14:44:58 +01:00
tag_ocelot_8021q.c net: dsa: remove the struct packet_type argument from dsa_device_ops::rcv() 2021-08-02 15:13:15 +01:00
tag_ocelot.c net: dsa: remove the struct packet_type argument from dsa_device_ops::rcv() 2021-08-02 15:13:15 +01:00
tag_qca.c net: dsa: create a helper for locating EtherType DSA headers on TX 2021-08-11 14:44:58 +01:00
tag_rtl4_a.c net: dsa: create a helper for locating EtherType DSA headers on TX 2021-08-11 14:44:58 +01:00
tag_sja1105.c net: dsa: tag_sja1105: be dsa_loop-safe 2021-08-18 10:33:15 +01:00
tag_trailer.c net: dsa: remove the struct packet_type argument from dsa_device_ops::rcv() 2021-08-02 15:13:15 +01:00
tag_xrs700x.c net: dsa: remove the struct packet_type argument from dsa_device_ops::rcv() 2021-08-02 15:13:15 +01:00