aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2015-02-04 09:56:58 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-05 03:35:00 -0500
commit7af348be47fd2df5d276add2167b5838d48ba044 (patch)
treeff8a64beb4b5f95526e66dd90f5df58cdb41a6a3
parent27b917e54bed7156c2b0249969ace34a5f585626 (diff)
net: ep93xx_eth: Delete unnecessary checks before the function call "kfree"
The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/cirrus/ep93xx_eth.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/cirrus/ep93xx_eth.c b/drivers/net/ethernet/cirrus/ep93xx_eth.c
index 3a12c096ea1c..de9f7c97d916 100644
--- a/drivers/net/ethernet/cirrus/ep93xx_eth.c
+++ b/drivers/net/ethernet/cirrus/ep93xx_eth.c
@@ -475,8 +475,7 @@ static void ep93xx_free_buffers(struct ep93xx_priv *ep)
475 if (d) 475 if (d)
476 dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_FROM_DEVICE); 476 dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_FROM_DEVICE);
477 477
478 if (ep->rx_buf[i] != NULL) 478 kfree(ep->rx_buf[i]);
479 kfree(ep->rx_buf[i]);
480 } 479 }
481 480
482 for (i = 0; i < TX_QUEUE_ENTRIES; i++) { 481 for (i = 0; i < TX_QUEUE_ENTRIES; i++) {
@@ -486,8 +485,7 @@ static void ep93xx_free_buffers(struct ep93xx_priv *ep)
486 if (d) 485 if (d)
487 dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_TO_DEVICE); 486 dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_TO_DEVICE);
488 487
489 if (ep->tx_buf[i] != NULL) 488 kfree(ep->tx_buf[i]);
490 kfree(ep->tx_buf[i]);
491 } 489 }
492 490
493 dma_free_coherent(dev, sizeof(struct ep93xx_descs), ep->descs, 491 dma_free_coherent(dev, sizeof(struct ep93xx_descs), ep->descs,