[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[redhat-lspp] Re: [RFC 2/7] NetLabel: core network changes
- From: Paul Moore <paul moore hp com>
- To: Steve Grubb <sgrubb redhat com>
- Cc: redhat-lspp redhat com
- Subject: [redhat-lspp] Re: [RFC 2/7] NetLabel: core network changes
- Date: Mon, 10 Jul 2006 10:56:32 -0400
Steve Grubb wrote:
> On Thursday 06 July 2006 17:34, paul moore hp com wrote:
>
>>+++ linux-2.6.17.i686-quilt/include/net/cipso_ipv4.h
>>+int cipso_v4_doi_remove(const u32 doi,
>>+ void (*callback) (struct rcu_head * head));
>>+struct sk_buff *cipso_v4_doi_dump(const u32 doi, const size_t headroom);
>>*domain);
>
> You do not need to have const on pass by value vars.
>
True, I agree it really doesn't matter from the perspective of the
machine but I think it can still be handy from the prespective of the
error prone people who try to write code for the machines. I've seen
several cases of the const modifier used on scalar values elsewhere in
the kernel ...
>>+++ linux-2.6.17.i686-quilt/include/net/netlabel.h
>>+static inline void netlbl_secattr_free(struct netlbl_lsm_secattr *secattr)
>>+{
>>+ BUG_ON(secattr == NULL);
>>+ if (secattr->set_domain)
>>+ kfree(secattr->domain);
>>+ if (secattr->set_mls_cat)
>>+ kfree(secattr->mls_cat);
>>+ if (secattr->set_cache && secattr->cache.free)
>>+ secattr->cache.free(secattr->cache.data);
>
> The 'if' statements are not needed. You can just kfree them.
>
Quick question - can you safely call kfree() on a NULL or uninitialized
pointer?
--
paul moore
linux security @ hp
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]