Skip to content

Commit

Permalink
SELinux: remove redundant pointer checks before calling kfree()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Moore authored and James Morris committed Aug 2, 2007
1 parent 9534f71 commit 088999e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
if (secdata)
kfree(secdata);
kfree(secdata);
}

#ifdef CONFIG_KEYS
Expand Down

0 comments on commit 088999e

Please sign in to comment.