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: <1390778623.2735.69.camel@deadeye.wl.decadent.org.uk>
Date:	Sun, 26 Jan 2014 23:23:43 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Wang Weidong <wangweidong1@...wei.com>
Cc:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] 8139cp: remove a won't occurred BUG_ON

On Sun, 2014-01-26 at 16:33 +0800, Wang Weidong wrote:
> when variable i go to the BUG_ON the value is equal to the CP_NUM_STATS,
> so the BUG_ON won't occur, so remove it

We hope that every BUG_ON() does not occur, but that doesn't mean they
should be removed.  This check is meant to catch mistakes when adding
new statistics.

Ben.

> Signed-off-by: Wang Weidong <wangweidong1@...wei.com>
> ---
>  drivers/net/ethernet/realtek/8139cp.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
> index 737c1a8..b70e184 100644
> --- a/drivers/net/ethernet/realtek/8139cp.c
> +++ b/drivers/net/ethernet/realtek/8139cp.c
> @@ -1585,7 +1585,6 @@ static void cp_get_ethtool_stats (struct net_device *dev,
>  	tmp_stats[i++] = le16_to_cpu(nic_stats->tx_abort);
>  	tmp_stats[i++] = le16_to_cpu(nic_stats->tx_underrun);
>  	tmp_stats[i++] = cp->cp_stats.rx_frags;
> -	BUG_ON(i != CP_NUM_STATS);
>  
>  	dma_free_coherent(&cp->pdev->dev, sizeof(*nic_stats), nic_stats, dma);
>  }

-- 
Ben Hutchings
If the facts do not conform to your theory, they must be disposed of.

Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ