Re: [PATCH] don't do pointless NULL checks and casts beforekfree() in security/

From: Stephen Smalley
Date: Tue Mar 22 2005 - 10:13:20 EST


On Sun, 2005-03-20 at 13:29 +0100, Jesper Juhl wrote:
> kfree() handles NULL pointers, so checking a pointer for NULL before
> calling kfree() on it is pointless. kfree() takes a void* argument and
> changing the type of a pointer before kfree()'ing it is equally pointless.
> This patch removes the pointless checks for NULL and needless mucking
> about with the pointer types before kfree() for all files in security/*
> where I could locate such code.
>
> The following files are modified by this patch:
> security/keys/key.c
> security/keys/user_defined.c
> security/selinux/hooks.c
> security/selinux/selinuxfs.c
> security/selinux/ss/conditional.c
> security/selinux/ss/policydb.c
> security/selinux/ss/services.c
>
> (please keep me on CC if you reply)
>
>
> Signed-off-by: Jesper Juhl <juhl-lkml@xxxxxx>

The diffs to selinux look fine to me, and the resulting kernel seems to
be operating without problem. Feel free to send along to Andrew Morton.

Acked-by: Stephen Smalley <sds@xxxxxxxxxxxxx>


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/