[PATCH 1/1] staging: gdm72xx: Remove redundant null check before kfree in gdm_wimax.c

Sachin Kamat sachin.kamat at linaro.org
Wed Nov 21 05:59:36 UTC 2012


kfree on a null pointer is a no-op.

Signed-off-by: Sachin Kamat <sachin.kamat at linaro.org>
---
 drivers/staging/gdm72xx/gdm_wimax.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c
index c302769..ea5accd 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.c
+++ b/drivers/staging/gdm72xx/gdm_wimax.c
@@ -535,10 +535,8 @@ static int gdm_wimax_close(struct net_device *dev)
 
 static void kdelete(void **buf)
 {
-	if (buf && *buf) {
-		kfree(*buf);
-		*buf = NULL;
-	}
+	kfree(*buf);
+	*buf = NULL;
 }
 
 static int gdm_wimax_ioctl_get_data(struct data_s *dst, struct data_s *src)
-- 
1.7.4.1




More information about the devel mailing list