Skip to content

Commit

Permalink
net: ep93xx_eth: Delete unnecessary checks before the function call "…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Markus Elfring authored and David S. Miller committed Feb 5, 2015
1 parent 27b917e commit 7af348b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/cirrus/ep93xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,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++) {
Expand All @@ -486,8 +485,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,
Expand Down

0 comments on commit 7af348b

Please sign in to comment.