bnx2: no need to check before vfreeing
authorBreno Leitao <leitao@linux.vnet.ibm.com>
Mon, 8 Jun 2009 10:30:19 +0000 (10:30 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Jun 2009 12:25:38 +0000 (05:25 -0700)
There is no need to check if a pointer is NULL before calling
vfree(), since vfree() function already check for it.

Signed-off-by: Breno Leitão <leitao@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bnx2.c

index 391d2d47089cdb60d768360bb1ec24a205a3381e..f99e17e0a319248e1ea7e1be4bfa627939167c99 100644 (file)
@@ -546,8 +546,7 @@ bnx2_free_rx_mem(struct bnx2 *bp)
                                                    rxr->rx_desc_mapping[j]);
                        rxr->rx_desc_ring[j] = NULL;
                }
-               if (rxr->rx_buf_ring)
-                       vfree(rxr->rx_buf_ring);
+               vfree(rxr->rx_buf_ring);
                rxr->rx_buf_ring = NULL;
 
                for (j = 0; j < bp->rx_max_pg_ring; j++) {
@@ -557,8 +556,7 @@ bnx2_free_rx_mem(struct bnx2 *bp)
                                                    rxr->rx_pg_desc_mapping[j]);
                        rxr->rx_pg_desc_ring[j] = NULL;
                }
-               if (rxr->rx_pg_ring)
-                       vfree(rxr->rx_pg_ring);
+               vfree(rxr->rx_pg_ring);
                rxr->rx_pg_ring = NULL;
        }
 }