|
|
Subscribe / Log in / New account

vfree can handle NULL (sound/oss/msnd.c)

From:  Jesper Juhl <juhl-lkml@dif.dk>
To:  linux-kernel@vger.kernel.org
Subject:  [PATCH] vfree can handle NULL (sound/oss/msnd.c)
Date:  Thu, 30 Jun 2005 22:39:01 +0200 (CEST)
Cc:  Andrew Veliath <andrewtv@usa.net>, linux-sound@vger.kernel.org, akpm@osdl.org

Nothing wrong in handing vfree a NULL pointer.

 sound/oss/msnd.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

--- linux-2.6.13-rc1-orig/sound/oss/msnd.c	2005-06-17 21:48:29.000000000 +0200
+++ linux-2.6.13-rc1/sound/oss/msnd.c	2005-06-30 22:35:41.000000000 +0200
@@ -96,10 +96,8 @@ void msnd_fifo_init(msnd_fifo *f)
 
 void msnd_fifo_free(msnd_fifo *f)
 {
-	if (f->data) {
-		vfree(f->data);
-		f->data = NULL;
-	}
+	vfree(f->data);
+	f->data = NULL;
 }
 
 int msnd_fifo_alloc(msnd_fifo *f, size_t n)


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



Copyright © 2005, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds