diff options
author | Thomas Liu <tliu@redhat.com> | 2009-06-24 17:58:05 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-06-24 18:29:16 -0400 |
commit | 89c86576ecde504da1eeb4f4882b2189ac2f9c4a (patch) | |
tree | 94674a48becd9cfde298e9fe6b58db8da28fe238 /security/selinux/avc.c | |
parent | a893a84e8799270fbec5c3708d001650aab47138 (diff) |
selinux: clean up avc node cache when disabling selinux
Added a call to free the avc_node_cache when inside selinux_disable because
it should not waste resources allocated during avc_init if SELinux is disabled
and the cache will never be used.
Signed-off-by: Thomas Liu <tliu@redhat.com>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux/avc.c')
-rw-r--r-- | security/selinux/avc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/security/selinux/avc.c b/security/selinux/avc.c index 7823e84dbe8d..236aaa2ea86d 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c | |||
@@ -970,3 +970,9 @@ u32 avc_policy_seqno(void) | |||
970 | { | 970 | { |
971 | return avc_cache.latest_notif; | 971 | return avc_cache.latest_notif; |
972 | } | 972 | } |
973 | |||
974 | void avc_disable(void) | ||
975 | { | ||
976 | if (avc_node_cachep) | ||
977 | kmem_cache_destroy(avc_node_cachep); | ||
978 | } | ||