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>
Sat, 31 Dec 2022 12:14:20 +0000 (13:14 +0100)
commit0fff763f110f11ddbfe860e78abb0861850644b6
tree66efcb8b8414316dbaac337afcda51a2184e7fc6
parent882bad40a0083c04f66d1d094cd391dd048becdf
net: lan9303: Fix read error execution path

[ Upstream commit 8964916d206071b058c6351f88b1966bd58cbde0 ]

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: a1292595e006 ("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