net: fec: Delete unnecessary checks before the function call "kfree"
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 4 Feb 2015 11:56:42 +0000 (12:56 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Feb 2015 08:26:04 +0000 (00:26 -0800)
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: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c

index 58cabee00abf9f35294f0b39294bdd9e70f657a8..9bb6220663b21a505f2332f028ce3a1e13b77f86 100644 (file)
@@ -2596,12 +2596,9 @@ static void fec_enet_free_queue(struct net_device *ndev)
                }
 
        for (i = 0; i < fep->num_rx_queues; i++)
-               if (fep->rx_queue[i])
-                       kfree(fep->rx_queue[i]);
-
+               kfree(fep->rx_queue[i]);
        for (i = 0; i < fep->num_tx_queues; i++)
-               if (fep->tx_queue[i])
-                       kfree(fep->tx_queue[i]);
+               kfree(fep->tx_queue[i]);
 }
 
 static int fec_enet_alloc_queue(struct net_device *ndev)