]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - security/apparmor/resource.c
Merge tag 'trace-v4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[karo-tx-linux.git] / security / apparmor / resource.c
index 67a6072ead4b9ed8efe98bdc57080c615839c32a..86a941afd9562a64a4116a0aa234b6e0e74e9728 100644 (file)
@@ -35,7 +35,7 @@ static void audit_cb(struct audit_buffer *ab, void *va)
        struct common_audit_data *sa = va;
 
        audit_log_format(ab, " rlimit=%s value=%lu",
-                        rlim_names[sa->aad->rlim.rlim], sa->aad->rlim.max);
+                        rlim_names[aad(sa)->rlim.rlim], aad(sa)->rlim.max);
 }
 
 /**
@@ -50,17 +50,12 @@ static void audit_cb(struct audit_buffer *ab, void *va)
 static int audit_resource(struct aa_profile *profile, unsigned int resource,
                          unsigned long value, int error)
 {
-       struct common_audit_data sa;
-       struct apparmor_audit_data aad = {0,};
-
-       sa.type = LSM_AUDIT_DATA_NONE;
-       sa.aad = &aad;
-       aad.op = OP_SETRLIMIT,
-       aad.rlim.rlim = resource;
-       aad.rlim.max = value;
-       aad.error = error;
-       return aa_audit(AUDIT_APPARMOR_AUTO, profile, GFP_KERNEL, &sa,
-                       audit_cb);
+       DEFINE_AUDIT_DATA(sa, LSM_AUDIT_DATA_NONE, OP_SETRLIMIT);
+
+       aad(&sa)->rlim.rlim = resource;
+       aad(&sa)->rlim.max = value;
+       aad(&sa)->error = error;
+       return aa_audit(AUDIT_APPARMOR_AUTO, profile, &sa, audit_cb);
 }
 
 /**