Subject: [PATCH 1/2] SELinux: remove redundant pointer checks before calling kfree()

From: "Paul Moore" <[email-masked]>
Date: Wed, 01 Aug 2007 11:12:58 -0400

We don't need to check for NULL pointers before calling kfree().

Signed-off-by: Paul Moore <[email-masked]>
---
 security/selinux/hooks.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: linux-2.6_secctx-leaks/security/selinux/hooks.c
===================================================================
--- linux-2.6_secctx-leaks.orig/security/selinux/hooks.c
+++ linux-2.6_secctx-leaks/security/selinux/hooks.c
@@ -4658,8 +4658,7 @@ static int selinux_secid_to_secctx(u32 s
 
 static void selinux_release_secctx(char *secdata, u32 seclen)
 {
-	if (secdata)
-		kfree(secdata);
+	kfree(secdata);
 }
 
 #ifdef CONFIG_KEYS

-- 
paul moore
linux security @ hp