Skip to contentSkip to conversation

cirrus: Remove redundant NULL check before kfree

PATCH In review Syam Sidhardhan 2 participants 2 messages Feb 26, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cirrus: Remove redundant NULL check before kfree

kfree on NULL pointer is a no-op.

---
 drivers/net/ethernet/cirrus/ep93xx_eth.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/cirrus/ep93xx_eth.c +2 -4
index 354cbb7..298aaa9 100644
@@ -476,8 +476,7 @@ static void ep93xx_free_buffers(struct ep93xx_priv *ep)
 		if (d)
 			dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_FROM_DEVICE);
 
-		if (ep->rx_buf[i] != NULL)
-			kfree(ep->rx_buf[i]);
+		kfree(ep->rx_buf[i]);
 	}
 
 	for (i = 0; i < TX_QUEUE_ENTRIES; i++) {
@@ -487,8 +486,7 @@ static void ep93xx_free_buffers(struct ep93xx_priv *ep)
 		if (d)
 			dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_TO_DEVICE);
 
-		if (ep->tx_buf[i] != NULL)
-			kfree(ep->tx_buf[i]);
+		kfree(ep->tx_buf[i]);
 	}
 
 	dma_free_coherent(dev, sizeof(struct ep93xx_descs), ep->descs,
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw

All of these NULL check removals are not bug fixes, and therefore not appropriate for the 'net' tree. They should be targetted at 'net-next' which is closed at this time.

Please resubmit your patches when I announce on netdev that 'net-next' is open for submissions once more.

Thanks.