linux/drivers
Arnd Bergmann ab58070569 mlxsw: spectrum_router: avoid potential uninitialized data usage
If fi->fib_nhs is zero, the router interface pointer is uninitialized, as shown by
this warning:

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c: In function 'mlxsw_sp_router_fib_event':
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:1674:21: error: 'r' may be used uninitialized in this function [-Werror=maybe-uninitialized]
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:1643:23: note: 'r' was declared here

This changes the loop so we handle the case the same way as finding no router
interface pointer attached to one of the nexthops to ensure we always
trap here instead of using uninitialized data.

Fixes: b45f64d16d ("mlxsw: spectrum_router: Use FIB notifications instead of switchdev calls")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-10-03 01:55:18 -04:00
..
accessibility
acpi nfit: fail DSMs that return non-zero status by default 2016-09-21 09:35:19 -07:00
amba
android
ata
atm
auxdisplay
base regmap: Fix for v4.8 2016-09-23 11:50:49 -07:00
bcma
block
bluetooth Bluetooth: Use single return in hci_uart_tty_ioctl() call 2016-09-24 06:40:24 +02:00
bus
cdrom
char
clk
clocksource
connector
cpufreq
cpuidle
crypto
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware
fmc
fpga
gpio
gpu drm/udl: fix line iterator in damage handling 2016-09-28 13:29:18 +10:00
hid
hsi
hv
hwmon
hwspinlock
hwtracing
i2c i2c: qup: skip qup_i2c_suspend if the device is already runtime suspended 2016-09-22 20:11:14 +02:00
ide
idle
iio
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-09-23 06:46:57 -04:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2016-09-30 21:25:09 -07:00
iommu
ipack
irqchip irqchip/mips-gic: Fix local interrupts 2016-09-20 23:20:02 +02:00
isdn
leds
lguest
lightnvm
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc mmc: dw_mmc: fix the spamming log message 2016-09-22 09:34:13 +02:00
mtd Another round of MTD fixes for v4.8 2016-09-28 12:53:08 -07:00
net mlxsw: spectrum_router: avoid potential uninitialized data usage 2016-10-03 01:55:18 -04:00
nfc
ntb
nubus
nvdimm libnvdimm, region: fix flush hint table thinko 2016-09-24 11:45:38 -07:00
nvme nvme-rdma: only clear queue flags after successful connect 2016-09-22 19:58:17 -06:00
nvmem
of
oprofile
parisc
parport
pci
pcmcia
perf
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-10-02 22:20:41 -04:00
sfi
sh
sn
soc
spi
spmi
ssb
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-09-23 06:46:57 -04:00
target
tc
thermal
thunderbolt
tty
uio
usb
uwb
vfio
vhost
video
virt
virtio
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile