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]
Date:   Tue, 28 Mar 2017 15:57:04 +0200
From:   Thierry Reding <thierry.reding@...il.com>
To:     Niklas Cassel <niklas.cassel@...s.com>
Cc:     Joao Pinto <Joao.Pinto@...opsys.com>,
        David Miller <davem@...emloft.net>, clabbe.montjoie@...il.com,
        peppe.cavallaro@...com, alexandre.torgue@...com,
        sergei.shtylyov@...entembedded.com, f.fainelli@...il.com,
        netdev@...r.kernel.org
Subject: [PATCH 1/3] net: stmmac: Remove unneeded checks for NULL pointer

From: Thierry Reding <treding@...dia.com>

Taking the address of an element within a non-NULL array will never be
zero. This condition isn't checked anywhere else, so drop it in these
two instances as well.

Signed-off-by: Thierry Reding <treding@...dia.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c78f444ad423..106ace3781b3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1332,9 +1332,6 @@ static void free_rx_dma_desc_resources(struct stmmac_priv *priv)
 	for (queue = 0; queue < rx_count; queue++) {
 		struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];
 
-		if (!rx_q)
-			break;
-
 		/* Release the DMA RX socket buffers */
 		dma_free_rx_skbufs(priv, queue);
 
@@ -1373,9 +1370,6 @@ static void free_tx_dma_desc_resources(struct stmmac_priv *priv)
 	for (queue = 0; queue < tx_count; queue++) {
 		struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue];
 
-		if (!tx_q)
-			break;
-
 		/* Release the DMA TX socket buffers */
 		dma_free_tx_skbufs(priv, queue);
 
-- 
2.12.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ