* [PATCH 1/1] bnx2: no need to check before vfreeing
@ 2009-06-08 20:30 Breno Leitao
0 siblings, 0 replies; only message in thread
From: Breno Leitao @ 2009-06-08 20:30 UTC (permalink / raw)
To: Michael Chan; +Cc: netdev
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>
---
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index b0cb29d..7d014dc 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -545,8 +545,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++) {
@@ -556,8 +555,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;
}
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-06-08 20:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-08 20:30 [PATCH 1/1] bnx2: no need to check before vfreeing Breno Leitao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).