linux/drivers/net/dsa/microchip
Colin Ian King 12c2bb96c3 net: dsa: ksz: Make reg_mib_cnt a u8 as it never exceeds 255
Currently the for-loop in ksz8_port_init_cnt is causing a static
analysis infinite loop warning with the comparison of
mib->cnt_ptr < dev->reg_mib_cnt. This occurs because mib->cnt_ptr
is a u8 and dev->reg_mib_cnt is an int and the analyzer determines
that mib->cnt_ptr potentially can wrap around to zero if the value
in dev->reg_mib_cnt is > 255. However, this value is never this
large, it is always less than 256 so make reg_mib_cnt a u8.

Addresses-Coverity: ("Infinite loop")
Fixes: e66f840c08 ("net: dsa: ksz: Add Microchip KSZ8795 DSA driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20210428120010.337959-1-colin.king@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-04-28 13:56:27 -07:00
..
Kconfig net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support 2021-04-27 14:13:24 -07:00
ksz8.h net: dsa: microchip: ksz8795: move register offsets and shifts to separate struct 2021-04-27 14:13:23 -07:00
ksz8795.c net: dsa: microchip: ksz8795: add support for ksz88xx chips 2021-04-27 14:13:24 -07:00
ksz8795_reg.h net: dsa: microchip: ksz8795: add support for ksz88xx chips 2021-04-27 14:13:24 -07:00
ksz8795_spi.c net: dsa: microchip: Add Microchip KSZ8863 SPI based driver support 2021-04-27 14:13:24 -07:00
ksz8863_smi.c net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support 2021-04-27 14:13:24 -07:00
ksz9477.c net: dsa: propagate extack to .port_vlan_filtering 2021-02-14 17:38:12 -08:00
ksz9477_i2c.c net: dsa: microchip: add ksz9563 to ksz9477 I2C driver 2020-10-09 13:05:56 -07:00
ksz9477_reg.h net: dsa: microchip: Use the correct style for SPDX License Identifier 2019-10-15 14:59:58 -07:00
ksz9477_spi.c net: dsa: microchip: ksz9477: setup SPI mode 2020-11-25 17:53:45 -08:00
ksz_common.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-01-28 17:09:31 -08:00
ksz_common.h net: dsa: ksz: Make reg_mib_cnt a u8 as it never exceeds 255 2021-04-28 13:56:27 -07:00
Makefile net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support 2021-04-27 14:13:24 -07:00