twx-linux/drivers
Xiaomeng Tong 6da69b1da1 net: dsa: bcm_sf2_cfp: fix an incorrect NULL check on list iterator
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: ae7a5aff783c7 ("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>
2022-03-28 14:38:38 -07:00
..
accessibility
acpi sound updates for 5.18 2022-03-23 15:11:12 -07:00
amba
android
ata ata changes for 5.18-rc1 2022-03-23 14:35:59 -07:00
atm Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-17 13:56:58 -07:00
auxdisplay
base Merge branch 'akpm' (patches from Andrew) 2022-03-22 16:11:53 -07:00
bcma
block Folio changes for 5.18 2022-03-22 17:03:12 -07:00
bluetooth Bluetooth: ath3k: remove superfluous header files 2022-03-18 17:12:09 +01:00
bus ARM driver updates for 5.18 2022-03-23 18:23:13 -07:00
cdrom
char ARM driver updates for 5.18 2022-03-23 18:23:13 -07:00
clk ARM driver updates for 5.18 2022-03-23 18:23:13 -07:00
clocksource asm-generic updates for 5.18 2022-03-23 18:03:08 -07:00
comedi
connector
counter
cpufreq Merge branch 'pm-tools' 2022-03-18 18:46:15 +01:00
cpuidle ARM driver updates for 5.18 2022-03-23 18:23:13 -07:00
crypto VFIO updates for v5.18-rc1 2022-03-24 12:35:59 -07:00
cxl
dax Filesystem folio changes for 5.18 2022-03-22 18:26:56 -07:00
dca
devfreq
dio
dma ARM development updates for 5.18: 2022-03-21 10:55:18 -07:00
dma-buf
edac Merge branch 'edac-amd64' into edac-updates-for-v5.18 2022-03-21 10:34:57 +01:00
eisa
extcon
firewire
firmware ARM driver updates for 5.18 2022-03-23 18:23:13 -07:00
fpga
fsi
gnss
gpio spi: Updates for v5.18 2022-03-21 18:33:57 -07:00
gpu flexible-array transformations for 5.18-rc1 2022-03-24 11:39:32 -07:00
greybus
hid asm-generic updates for 5.18 2022-03-23 18:03:08 -07:00
hsi
hv hyperv-next for 5.18 2022-03-24 12:30:37 -07:00
hwmon spi: Updates for v5.18 2022-03-21 18:33:57 -07:00
hwspinlock
hwtracing flexible-array transformations for 5.18-rc1 2022-03-24 11:39:32 -07:00
i2c
i3c
idle
iio spi: Updates for v5.18 2022-03-21 18:33:57 -07:00
infiniband Networking changes for 5.18. 2022-03-24 13:13:26 -07:00
input media updates for v5.18-rc1 2022-03-23 14:51:35 -07:00
interconnect
iommu media updates for v5.18-rc1 2022-03-23 14:51:35 -07:00
ipack
irqchip asm-generic updates for 5.18 2022-03-23 18:03:08 -07:00
isdn mISDN: fix typo "frame to short" -> "frame too short" 2022-03-21 13:26:38 +00:00
leds
macintosh
mailbox
mcb
md for-5.18/drivers-2022-03-18 2022-03-21 17:16:01 -07:00
media media updates for v5.18-rc1 2022-03-23 14:51:35 -07:00
memory ARM driver updates for 5.18 2022-03-23 18:23:13 -07:00
memstick
message
mfd spi: Updates for v5.18 2022-03-21 18:33:57 -07:00
misc Networking changes for 5.18. 2022-03-24 13:13:26 -07:00
mmc MMC core: 2022-03-23 14:39:51 -07:00
most
mtd spi: Updates for v5.18 2022-03-21 18:33:57 -07:00
mux
net net: dsa: bcm_sf2_cfp: fix an incorrect NULL check on list iterator 2022-03-28 14:38:38 -07:00
nfc spi: Updates for v5.18 2022-03-21 18:33:57 -07:00
ntb
nubus
nvdimm Folio changes for 5.18 2022-03-22 17:03:12 -07:00
nvme Folio changes for 5.18 2022-03-22 17:03:12 -07:00
nvmem
of cma: factor out minimum alignment requirement 2022-03-22 15:57:05 -07:00
opp
parisc
parport
pci VFIO updates for v5.18-rc1 2022-03-24 12:35:59 -07:00
pcmcia
perf
phy
pinctrl ARM: DT updates for 5.18 2022-03-23 18:37:22 -07:00
platform sound updates for 5.18 2022-03-23 15:11:12 -07:00
pnp PNP update for 5.18-rc1 2022-03-21 14:46:01 -07:00
power
powercap
pps
ps3
ptp ptp: ocp: use snprintf() in ptp_ocp_verify() 2022-03-18 21:42:09 -07:00
pwm
rapidio
ras
regulator regulator: Updates for v5.18 2022-03-21 18:27:05 -07:00
remoteproc
reset
rpmsg
rtc
s390 Networking changes for 5.18. 2022-03-24 13:13:26 -07:00
sbus
scsi flexible-array transformations for 5.18-rc1 2022-03-24 11:39:32 -07:00
sh
siox
slimbus
soc Networking changes for 5.18. 2022-03-24 13:13:26 -07:00
soundwire
spi spi: Updates for v5.18 2022-03-21 18:33:57 -07:00
spmi
ssb
staging Networking changes for 5.18. 2022-03-24 13:13:26 -07:00
target
tc
tee ARM driver updates for 5.18 2022-03-23 18:23:13 -07:00
thermal Merge branch 'thermal-hfi' 2022-03-18 19:00:26 +01:00
thunderbolt
tty Merge branch 'akpm' (patches from Andrew) 2022-03-22 16:11:53 -07:00
uio
usb media updates for v5.18-rc1 2022-03-23 14:51:35 -07:00
vdpa
vfio
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-17 13:56:58 -07:00
video asm-generic updates for 5.18 2022-03-23 18:03:08 -07:00
virt
virtio mm: enforce pageblock_order < MAX_ORDER 2022-03-22 15:57:06 -07:00
visorbus
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile