diff options
author | Jeff Vander Stoep <jeffv@google.com> | 2015-04-20 17:45:42 -0700 |
---|---|---|
committer | Jeff Vander Stoep <jeffv@google.com> | 2015-04-21 09:34:29 -0700 |
commit | e623b152f30f6f1204919315df37244d69e5d55e (patch) | |
tree | 111cbcc42bf15d1755c65fcb3c508b0539c30c33 /security | |
parent | 9db05f0ba22050da1f53d918ce0ebde79dd85a83 (diff) |
SELinux: use deletion-safe iterator to free list
This code is not exercised by policy version 26, but will be upon
upgrade to policy version 30.
Bug: 18087110
Change-Id: I07c6f34607713294a6a12c43a64d9936f0602200
Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/avc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/security/selinux/avc.c b/security/selinux/avc.c index 76766f4c920b..21a34153df14 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c @@ -298,13 +298,15 @@ static void avc_operation_decision_free( static void avc_operation_free(struct avc_operation_node *ops_node) { - struct avc_operation_decision_node *od_node; + struct avc_operation_decision_node *od_node, *tmp; if (!ops_node) return; - list_for_each_entry(od_node, &ops_node->od_head, od_list) + list_for_each_entry_safe(od_node, tmp, &ops_node->od_head, od_list) { + list_del(&od_node->od_list); avc_operation_decision_free(od_node); + } kmem_cache_free(avc_operation_node_cachep, ops_node); } |