lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1407963162.19680.1.camel@prashant>
Date:	Wed, 13 Aug 2014 13:52:42 -0700
From:	Prashant Sreedharan <prashant@...adcom.com>
To:	Govindarajulu Varadarajan <_govind@....com>
CC:	<davem@...emloft.net>, <mchan@...adcom.com>,
	<netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] tg3: fix return value in tg3_get_stats64

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@....com>

Acked-by: Prashant Sreedharan <prashant@...adcom.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);


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ