From: Breno Leitao <leitao@linux•vnet.ibm.com>
To: Michael Chan <mchan@broadcom•com>
Cc: netdev <netdev@vger•kernel.org>
Subject: [PATCH 1/1] bnx2: no need to check before vfreeing
Date: Mon, 08 Jun 2009 17:30:19 -0300 [thread overview]
Message-ID: <4A2D74DB.7030001@linux.vnet.ibm.com> (raw)
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;
}
}
reply other threads:[~2009-06-08 20:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A2D74DB.7030001@linux.vnet.ibm.com \
--to=leitao@linux$(echo .)vnet.ibm.com \
--cc=mchan@broadcom$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox