linux/drivers/net/dsa
Xiaomeng Tong 1752fcd404 net: dsa: bcm_sf2_cfp: fix an incorrect NULL check on list iterator
[ Upstream commit 6da69b1da1 ]

The bug is here:
	return rule;

The list iterator value 'rule' will *always* be set and non-NULL
by list_for_each_entry(), so it is incorrect to assume that the
iterator value will be NULL if the list is empty or no element
is found.

To fix the bug, return 'rule' when found, otherwise return NULL.

Fixes: ae7a5aff78 ("net: dsa: bcm_sf2: Keep copy of inserted rules")
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Link: https://lore.kernel.org/r/20220328032431.22538-1-xiam0nd.tong@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-08 14:40:30 +02:00
..
b53 net: dsa: b53: Fix IMP port setup on BCM5301x 2021-09-22 12:28:05 +02:00
microchip net: dsa: microchip: add spi_device_id tables 2022-04-08 14:39:48 +02:00
mv88e6xxx net: dsa: mv88e6xxx: Enable port policy support on 6097 2022-04-08 14:40:15 +02:00
ocelot net: dsa: felix: don't use devres for mdiobus 2022-02-16 12:54:25 +01:00
qca net: dsa: ar9331: register the mdiobus under devres 2022-02-16 12:54:25 +01:00
sja1105 net: dsa: sja1105: fix broken backpressure in .port_fdb_dump 2021-08-18 08:59:12 +02:00
bcm_sf2_cfp.c net: dsa: bcm_sf2_cfp: fix an incorrect NULL check on list iterator 2022-04-08 14:40:30 +02:00
bcm_sf2_regs.h
bcm_sf2.c net: dsa: bcm_sf2: don't use devres for mdiobus 2022-02-16 12:54:25 +01:00
bcm_sf2.h net: dsa: bcm_sf2: recalculate switch clock rate based on ports 2020-09-03 15:08:03 -07:00
dsa_loop_bdinfo.c
dsa_loop.c net: dsa: propagate switchdev vlan_filtering prepare phase to drivers 2020-10-05 05:56:48 -07:00
dsa_loop.h
Kconfig net: dsa: mt7530: make NET_DSA_MT7530 select MEDIATEK_GE_PHY 2022-02-08 18:30:41 +01:00
lan9303_i2c.c
lan9303_mdio.c
lan9303-core.c net: dsa: lan9303: fix reset on probe 2022-02-23 12:01:01 +01:00
lan9303.h
lantiq_gswip.c net: dsa: lantiq_gswip: fix use after free in gswip_remove() 2022-02-23 12:01:02 +01:00
lantiq_pce.h
Makefile
mt7530.c net: dsa: mt7530: fix incorrect test in mt753x_phylink_validate() 2022-03-16 14:15:57 +01:00
mt7530.h net: dsa: mt7530: Add the support of MT7531 switch 2020-09-14 16:30:39 -07:00
mv88e6060.c
mv88e6060.h
qca8k.c net: dsa: qca8k: Fix port MTU setting 2020-11-02 15:14:59 -08:00
qca8k.h net: dsa: qca8k: Add 802.1q VLAN support 2020-08-03 15:45:39 -07:00
realtek-smi-core.c net: dsa: realtek: register the MDIO bus under devres 2021-09-30 10:11:02 +02:00
realtek-smi-core.h net: dsa: rtl8366rb: Roof MTU for switch 2020-10-10 11:25:05 -07:00
rtl8366.c net: dsa: propagate switchdev vlan_filtering prepare phase to drivers 2020-10-05 05:56:48 -07:00
rtl8366rb.c net: dsa: rtl8366rb: Fix off-by-one bug 2021-11-18 14:04:03 +01:00
vitesse-vsc73xx-core.c
vitesse-vsc73xx-platform.c net: dsa: vitesse-vsc73xx: Convert to plain comments to avoid kerneldoc warnings 2020-07-05 15:49:03 -07:00
vitesse-vsc73xx-spi.c net: dsa: vitesse-vsc73xx: Convert to plain comments to avoid kerneldoc warnings 2020-07-05 15:49:03 -07:00
vitesse-vsc73xx.h