summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/tg3.c
diff options
context:
space:
mode:
authorGovindarajulu Varadarajan <_govind@gmx.com>2014-08-13 09:34:56 +0200
committerDavid S. Miller <davem@davemloft.net>2014-08-14 05:04:47 +0200
commit7b31b4deda7679120379c005df8d3d647161eff7 (patch)
tree8596d1e8d49180a1e68eac5749e21768626a65e2 /drivers/net/ethernet/broadcom/tg3.c
parentsunvnet: Schedule maybe_tx_wakeup() as a tasklet from ldc_rx path (diff)
downloadlinux-7b31b4deda7679120379c005df8d3d647161eff7.tar.xz
linux-7b31b4deda7679120379c005df8d3d647161eff7.zip
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: Govindarajulu Varadarajan <_govind@gmx.com> Acked-by: Prashant Sreedharan <prashant@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/tg3.c')
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index a3dd5dc64f4c..4296b3d26f02 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -14093,8 +14093,9 @@ static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev,
spin_lock_bh(&tp->lock);
if (!tp->hw_stats) {
+ *stats = tp->net_stats_prev;
spin_unlock_bh(&tp->lock);
- return &tp->net_stats_prev;
+ return stats;
}
tg3_get_nstats(tp, stats);