linux-stable/drivers/net/phy
Nikita Kiryushin f1e560cdb1 net: phy: fix phy_read_poll_timeout argument type in genphy_loopback
[ Upstream commit 32fa4366cc ]

read_poll_timeout inside phy_read_poll_timeout can set val negative
in some cases (for example, __mdiobus_read inside phy_read can return
-EOPNOTSUPP).

Supposedly, commit 4ec7329517 ("net: phylib: fix phy_read*_poll_timeout()")
should fix problems with wrong-signed vals, but I do not see how
as val is sent to phy_read as is and __val = phy_read (not val)
is checked for sign.

Change val type for signed to allow better error handling as done in other
phy_read_poll_timeout callers. This will not fix any error handling
by itself, but allows, for example, to modify cond with appropriate
sign check or check resulting val separately.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 014068dcb5 ("net: phy: genphy_loopback: add link speed configuration")
Signed-off-by: Nikita Kiryushin <kiryushin@ancud.ru>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20240315175052.8049-1-kiryushin@ancud.ru
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:21:36 -04:00
..
mscc ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
Kconfig
Makefile
adin.c
amd.c
aquantia.h
aquantia_hwmon.c
aquantia_main.c net: phy: aquantia: wait for the suspend/resume operations to finish 2022-09-28 11:11:47 +02:00
at803x.c net: phy: at803x: remove set/get wol callbacks for AR8032 2023-08-16 18:22:01 +02:00
ax88796b.c net: phy: ax88772a: fix lost pause advertisement configuration 2022-07-07 17:53:28 +02:00
bcm-cygnus.c
bcm-phy-lib.c
bcm-phy-lib.h
bcm7xxx.c
bcm63xx.c
bcm87xx.c
bcm54140.c
bcm84881.c
broadcom.c net: phy: broadcom: stub c45 read/write for 54810 2023-08-26 14:23:34 +02:00
cicada.c
cortina.c
davicom.c
dp83tc811.c
dp83640.c
dp83640_reg.h
dp83822.c net: phy: dp83822: Fix RGMII TX delay configuration 2024-03-26 18:21:22 -04:00
dp83848.c
dp83867.c Revert "net: phy: dp83867: perform soft reset and retain established link" 2023-06-28 10:29:49 +02:00
dp83869.c net: phy: dp83869: fix default value for tx-/rx-internal-delay 2023-04-05 11:24:59 +02:00
et1011c.c
fixed_phy.c
icplus.c
intel-xway.c
linkmode.c
lxt.c
marvell-88x2222.c
marvell.c net: phy: marvell: add sleep time after enabling the loopback bit 2022-11-26 09:24:47 +01:00
marvell10g.c net: phy: marvell10g: fix 88x3310 power up 2023-08-03 10:22:33 +02:00
mdio-boardinfo.c
mdio-boardinfo.h
mdio_bus.c net: mdio: validate parameter addr in mdiobus_get_phy() 2023-02-01 08:27:10 +01:00
mdio_device.c net: mdio: fix unbalanced fwnode reference count in mdio_device_release() 2022-12-14 11:37:28 +01:00
mdio_devres.c net: mdio: fix owner field for mdio buses registered using device-tree 2023-03-30 12:47:46 +02:00
mediatek-ge.c
meson-gxl.c net: phy: meson-gxl: use MMD access dummy stubs for GXL, internal PHY 2023-02-14 19:17:59 +01:00
micrel.c net: phy: micrel: populate .soft_reset for KSZ9131 2024-01-25 14:52:53 -08:00
microchip.c net: lan78xx: fix accessing the LAN7800's internal phy specific registers from the MAC driver 2023-03-17 08:48:54 +01:00
microchip_t1.c
mii_timestamper.c
motorcomm.c
mxl-gpy.c net: phy: mxl-gpy: fix version reporting 2022-12-14 11:37:29 +01:00
national.c
nxp-c45-tja11xx.c net: phy: nxp-c45-tja11xx: fix unsigned long multiplication overflow 2023-04-20 12:13:55 +02:00
nxp-tja11xx.c
phy-c45.c
phy-core.c
phy.c net: phy: Ensure state transitions are processed from phy_stop() 2023-03-30 12:47:45 +02:00
phy_device.c net: phy: fix phy_read_poll_timeout argument type in genphy_loopback 2024-03-26 18:21:36 -04:00
phy_led_triggers.c
phylink.c net: phylink: initialize carrier state at creation 2023-11-28 16:56:34 +00:00
qsemi.c
realtek.c
rockchip.c
sfp-bus.c
sfp.c net: sfp: initialize sfp->i2c_block_size at sfp allocation 2023-04-20 12:13:55 +02:00
sfp.h
smsc.c net: phy: smsc: bail out in lan87xx_read_status if genphy_read_status fails 2023-03-22 13:31:26 +01:00
spi_ks8995.c
ste10Xp.c
swphy.c
swphy.h
teranetics.c
uPD60620.c
vitesse.c
xilinx_gmii2rgmii.c net: phy: xgmiitorgmii: Fix refcount leak in xgmiitorgmii_probe 2023-01-12 11:59:13 +01:00