]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - security/apparmor/lib.c
Merge tag 'trace-v4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[karo-tx-linux.git] / security / apparmor / lib.c
index bcd598c7ca9d1f754162c81c8baf42a781ed8ff9..66475bda6f72212c330e7c6f8febfc930beb4e74 100644 (file)
@@ -120,11 +120,9 @@ const char *aa_splitn_fqname(const char *fqname, size_t n, const char **ns_name,
 void aa_info_message(const char *str)
 {
        if (audit_enabled) {
-               struct common_audit_data sa;
-               struct apparmor_audit_data aad = {0,};
-               sa.type = LSM_AUDIT_DATA_NONE;
-               sa.aad = &aad;
-               aad.info = str;
+               DEFINE_AUDIT_DATA(sa, LSM_AUDIT_DATA_NONE, NULL);
+
+               aad(&sa)->info = str;
                aa_audit_msg(AUDIT_APPARMOR_STATUS, &sa, NULL);
        }
        printk(KERN_INFO "AppArmor: %s\n", str);
@@ -197,15 +195,8 @@ bool aa_policy_init(struct aa_policy *policy, const char *prefix,
  */
 void aa_policy_destroy(struct aa_policy *policy)
 {
-       /* still contains profiles -- invalid */
-       if (on_list_rcu(&policy->profiles)) {
-               AA_ERROR("%s: internal error, policy '%s' contains profiles\n",
-                        __func__, policy->name);
-       }
-       if (on_list_rcu(&policy->list)) {
-               AA_ERROR("%s: internal error, policy '%s' still on list\n",
-                        __func__, policy->name);
-       }
+       AA_BUG(on_list_rcu(&policy->profiles));
+       AA_BUG(on_list_rcu(&policy->list));
 
        /* don't free name as its a subset of hname */
        kzfree(policy->hname);