]> git.baikalelectronics.ru Git - kernel.git/commit
net: lan9303: Fix read error execution path
authorJerry Ray <jerry.ray@microchip.com>
Fri, 9 Dec 2022 15:35:02 +0000 (09:35 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:15 +0000 (11:41 +0100)
commit2e83f1f49124c63d8689a9af97e0c0e57bb51141
tree1b3c2457127d3ecaab43f86cfebd31f6ec96bd0b
parenta07bddce959d560479be5c53e842dafda2269235
net: lan9303: Fix read error execution path

[ Upstream commit b3d7a4aa3141b184337c3189e6395dcd9901ccb5 ]

This patch fixes an issue where a read failure of a port statistic counter
will return unknown results.  While it is highly unlikely the read will
ever fail, it is much cleaner to return a zero for the stat count.

Fixes: 3bbb5663f4fc ("net: dsa: add new DSA switch driver for the SMSC-LAN9303")
Signed-off-by: Jerry Ray <jerry.ray@microchip.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20221209153502.7429-1-jerry.ray@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/lan9303-core.c