Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Markus Elfring and committed by
David S. Miller
7af348be 27b917e5

+2 -4
+2 -4
drivers/net/ethernet/cirrus/ep93xx_eth.c
··· 475 475 if (d) 476 476 dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_FROM_DEVICE); 477 477 478 - if (ep->rx_buf[i] != NULL) 479 - kfree(ep->rx_buf[i]); 478 + kfree(ep->rx_buf[i]); 480 479 } 481 480 482 481 for (i = 0; i < TX_QUEUE_ENTRIES; i++) { ··· 485 486 if (d) 486 487 dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_TO_DEVICE); 487 488 488 - if (ep->tx_buf[i] != NULL) 489 - kfree(ep->tx_buf[i]); 489 + kfree(ep->tx_buf[i]); 490 490 } 491 491 492 492 dma_free_coherent(dev, sizeof(struct ep93xx_descs), ep->descs,