Commit 7b31b4de authored by Govindarajulu Varadarajan's avatar Govindarajulu Varadarajan Committed by David S. Miller

tg3: fix return value in tg3_get_stats64

When tp->hw_stats is 0, tg3_get_stats64 should display previously
recorded stats. So it returns &tp->net_stats_prev. But the caller,
dev_get_stats, ignores the return value.

Fix this by assigning tp->net_stats_prev to stats and returning stats.
Signed-off-by: default avatarGovindarajulu Varadarajan <_govind@gmx.com>
Acked-by: default avatarPrashant Sreedharan <prashant@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1d311ad2
...@@ -14093,8 +14093,9 @@ static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev, ...@@ -14093,8 +14093,9 @@ static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev,
spin_lock_bh(&tp->lock); spin_lock_bh(&tp->lock);
if (!tp->hw_stats) { if (!tp->hw_stats) {
*stats = tp->net_stats_prev;
spin_unlock_bh(&tp->lock); spin_unlock_bh(&tp->lock);
return &tp->net_stats_prev; return stats;
} }
tg3_get_nstats(tp, stats); tg3_get_nstats(tp, stats);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment