This patch is a prerequisite for another patch. It does not change the behavior on the success path. Signed-off-by: David Yang --- drivers/net/dsa/yt921x.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/dsa/yt921x.c b/drivers/net/dsa/yt921x.c index 77864dcbb6c5..c72a74ed29cf 100644 --- a/drivers/net/dsa/yt921x.c +++ b/drivers/net/dsa/yt921x.c @@ -717,6 +717,11 @@ static int yt921x_read_mib(struct yt921x_priv *priv, int port) WRITE_ONCE(*valp, val); } + if (res) { + print_port_err(dev, port, res, "read stats for"); + return res; + } + pp->rx_frames = mib->rx_64byte + mib->rx_65_127byte + mib->rx_128_255byte + mib->rx_256_511byte + mib->rx_512_1023byte + mib->rx_1024_1518byte + @@ -726,9 +731,7 @@ static int yt921x_read_mib(struct yt921x_priv *priv, int port) mib->tx_512_1023byte + mib->tx_1024_1518byte + mib->tx_jumbo; - if (res) - print_port_err(dev, port, res, "read stats for"); - return res; + return 0; } static void yt921x_poll_mib(struct work_struct *work) -- 2.51.0