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>
This commit is contained in:
Jeff Vander Stoep
2015-06-30 12:53:17 +05:30
committed by Samir Mehta
parent 27975d31f9
commit 6506870a5a
+4 -2
View File
@@ -306,13 +306,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);
}