Skip to content

Commit 5fd1b95

Browse files
committed
apparmor: update policy_destroy to use new debug asserts
Signed-off-by: John Johansen <[email protected]>
1 parent d102d89 commit 5fd1b95

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

security/apparmor/lib.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,8 @@ bool aa_policy_init(struct aa_policy *policy, const char *prefix,
197197
*/
198198
void aa_policy_destroy(struct aa_policy *policy)
199199
{
200-
/* still contains profiles -- invalid */
201-
if (on_list_rcu(&policy->profiles)) {
202-
AA_ERROR("%s: internal error, policy '%s' contains profiles\n",
203-
__func__, policy->name);
204-
}
205-
if (on_list_rcu(&policy->list)) {
206-
AA_ERROR("%s: internal error, policy '%s' still on list\n",
207-
__func__, policy->name);
208-
}
200+
AA_BUG(on_list_rcu(&policy->profiles));
201+
AA_BUG(on_list_rcu(&policy->list));
209202

210203
/* don't free name as its a subset of hname */
211204
kzfree(policy->hname);

0 commit comments

Comments
 (0)