浏览代码

SELinux: remove redundant pointer checks before calling kfree()

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

Signed-off-by: Paul Moore <paul.moore@hp.com>
Acked-by:  Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
Paul Moore 18 年之前
父节点
当前提交
088999e98b
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      security/selinux/hooks.c

+ 1 - 2
security/selinux/hooks.c

@@ -4658,8 +4658,7 @@ static int selinux_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
 
 
 static void selinux_release_secctx(char *secdata, u32 seclen)
 static void selinux_release_secctx(char *secdata, u32 seclen)
 {
 {
-	if (secdata)
-		kfree(secdata);
+	kfree(secdata);
 }
 }
 
 
 #ifdef CONFIG_KEYS
 #ifdef CONFIG_KEYS