Skip to contentSkip to conversation

net: no need check in tehuti.c

PATCH Applied Figo.zhang 2 participants 2 messages Jun 10, 2009 – Jun 11, 2009

Subsystems (2)
lore
Share & tools
lore

Figo.zhang

author
#0 lore raw

PATCH 1/1 net: no need check in tehuti.c

vfree() does its own 'NULL' check, so no need for check before calling it.

---
drivers/net/tehuti.c | 9 +++------

 1 files changed, 3 insertions(+), 6 deletions(-)
drivers/net/tehuti.c +3 -6
index 7f4a968..430f2af 100644
@@ -948,8 +948,7 @@ static void print_rxfd(struct rxf_desc *rxfd);
 
 static void bdx_rxdb_destroy(struct rxdb *db)
 {
-	if (db)
-		vfree(db);
+	vfree(db);
 }
 
 static struct rxdb *bdx_rxdb_create(int nelem)
@@ -1482,10 +1481,8 @@ static void bdx_tx_db_close(struct txdb *d)
 {
 	BDX_ASSERT(d == NULL);
 
-	if (d->start) {
-		vfree(d->start);
-		d->start = NULL;
-	}
+	vfree(d->start);
+	d->start = NULL;
 }
 
 /*************************************************************************