From: Prashant Sreedharan <prashant@broadcom.com>
To: Govindarajulu Varadarajan <_govind@gmx.com>
Cc: <davem@davemloft.net>, <mchan@broadcom.com>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] tg3: fix return value in tg3_get_stats64
Date: Wed, 13 Aug 2014 13:52:42 -0700 [thread overview]
Message-ID: <1407963162.19680.1.camel@prashant> (raw)
In-Reply-To: <1407915296-12692-1-git-send-email-_govind@gmx.com>
On Wed, 2014-08-13 at 13:04 +0530, Govindarajulu Varadarajan wrote:
> 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>
> ---
> drivers/net/ethernet/broadcom/tg3.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index a3dd5dc..4296b3d26 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);
next prev parent reply other threads:[~2014-08-13 21:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-13 7:34 [PATCH net-next] tg3: fix return value in tg3_get_stats64 Govindarajulu Varadarajan
2014-08-13 20:52 ` Prashant Sreedharan [this message]
2014-08-13 23:17 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1407963162.19680.1.camel@prashant \
--to=prashant@broadcom.com \
--cc=_govind@gmx.com \
--cc=davem@davemloft.net \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).