Patchwork netxen: fix checking

login
register
mail settings
Submitter Figo.zhang
Date June 10, 2009, 2:13 p.m.
Message ID <1244643227.3422.3.camel@myhost>
Download mbox | patch
Permalink /patch/28409/
State Accepted
Delegated to: David Miller
Headers show

Comments

Figo.zhang - June 10, 2009, 2:13 p.m.
vfree() does its own 'NULL' check, so no need for check before
calling it.

Signed-off-by: Figo.zhang <figo1802@gmail.com>
---   
 drivers/net/netxen/netxen_nic_init.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - June 11, 2009, 9:51 a.m.
From: "Figo.zhang" <figo1802@gmail.com>
Date: Wed, 10 Jun 2009 22:13:47 +0800

> vfree() does its own 'NULL' check, so no need for check before
> calling it.
> 
> Signed-off-by: Figo.zhang <figo1802@gmail.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 0759c35..7ab0aa4 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -208,14 +208,11 @@  void netxen_free_sw_resources(struct netxen_adapter *adapter)
 	recv_ctx = &adapter->recv_ctx;
 	for (ring = 0; ring < adapter->max_rds_rings; ring++) {
 		rds_ring = &recv_ctx->rds_rings[ring];
-		if (rds_ring->rx_buf_arr) {
-			vfree(rds_ring->rx_buf_arr);
-			rds_ring->rx_buf_arr = NULL;
-		}
+		vfree(rds_ring->rx_buf_arr);
+		rds_ring->rx_buf_arr = NULL;
 	}
 
-	if (adapter->cmd_buf_arr)
-		vfree(adapter->cmd_buf_arr);
+	vfree(adapter->cmd_buf_arr);
 	return;
 }