Skip to content

Commit

Permalink
bnx2: no need to check before vfreeing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Breno Leitao authored and David S. Miller committed Jun 9, 2009
1 parent 3d8fd38 commit 25b0b99
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 25b0b99

Please sign in to comment.