kernel_samsung_a53x/drivers/net/dsa
Simon Horman af1d30c871 net: dsa: mv88e6xxx: Correct check for empty list
[ Upstream commit 4c7f3950a9fd53a62b156c0fe7c3a2c43b0ba19b ]

Since commit a3c53be55c95 ("net: dsa: mv88e6xxx: Support multiple MDIO
busses") mv88e6xxx_default_mdio_bus() has checked that the
return value of list_first_entry() is non-NULL.

This appears to be intended to guard against the list chip->mdios being
empty.  However, it is not the correct check as the implementation of
list_first_entry is not designed to return NULL for empty lists.

Instead, use list_first_entry_or_null() which does return NULL if the
list is empty.

Flagged by Smatch.
Compile tested only.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240430-mv88e6xx-list_empty-v3-1-c35c69d88d2e@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 14:19:40 +01:00
..
b53 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
microchip net: dsa: microchip: fix initial port flush problem 2024-11-19 14:19:31 +01:00
mv88e6xxx net: dsa: mv88e6xxx: Correct check for empty list 2024-11-19 14:19:40 +01:00
ocelot Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qca Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sja1105 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcm_sf2.c net: dsa: bcm_sf2: Fix possible memory leak in bcm_sf2_mdio_register() 2024-11-08 11:26:11 +01:00
bcm_sf2.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcm_sf2_cfp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcm_sf2_regs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dsa_loop.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dsa_loop.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dsa_loop_bdinfo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lan9303-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lan9303.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lan9303_i2c.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lan9303_mdio.c net: dsa: lan9303: consequently nested-lock physical MDIO 2024-11-18 11:43:30 +01:00
lantiq_gswip.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lantiq_pce.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mt7530.c net: dsa: mt7530: prevent possible incorrect XTAL frequency selection 2024-11-19 08:44:59 +01:00
mt7530.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mv88e6060.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mv88e6060.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qca8k.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qca8k.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
realtek-smi-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
realtek-smi-core.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rtl8366.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rtl8366rb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vitesse-vsc73xx-core.c net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe 2024-11-18 12:12:51 +01:00
vitesse-vsc73xx-platform.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vitesse-vsc73xx-spi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vitesse-vsc73xx.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00