[PATCH] vfree() cleanup in drivers/net/bsd_comp.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can pass NULL pointers to vfree() just fine. There's no bennefit in 
checking first if the pointer is != NULL.

Signed-off-by: Jesper Juhl <[email protected]>
---

 drivers/net/bsd_comp.c |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

--- linux-2.6.13-rc1-orig/drivers/net/bsd_comp.c	2005-06-17 21:48:29.000000000 +0200
+++ linux-2.6.13-rc1/drivers/net/bsd_comp.c	2005-06-30 00:38:32.000000000 +0200
@@ -46,13 +46,13 @@
 
 /*
  * This version is for use with contiguous buffers on Linux-derived systems.
  *
- *  ==FILEVERSION 20000226==
+ *  ==FILEVERSION 20050630==
  *
  *  NOTE TO MAINTAINERS:
  *     If you modify this file at all, please set the number above to the
- *     date of the modification as YYMMDD (year month day).
+ *     date of the modification as YYYYMMDD (year month day).
  *     bsd_comp.c is shipped with a PPP distribution as well as with
  *     the kernel; if everyone increases the FILEVERSION number above,
  *     then scripts can do the right thing when deciding whether to
  *     install a new bsd_comp.c file. Don't change the format of that
@@ -330,25 +330,19 @@ static void bsd_free (void *state)
       {
 /*
  * Release the dictionary
  */
-	if (db->dict)
-	  {
-	    vfree (db->dict);
-	    db->dict = NULL;
-	  }
+	vfree(db->dict);
+	db->dict = NULL;
 /*
  * Release the string buffer
  */
-	if (db->lens)
-	  {
-	    vfree (db->lens);
-	    db->lens = NULL;
-	  }
+	vfree(db->lens);
+	db->lens = NULL;
 /*
  * Finally release the structure itself.
  */
-	kfree (db);
+	kfree(db);
       }
   }
 
 /*



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux