summaryrefslogtreecommitdiffstats
path: root/security/integrity/ima/ima_init.c
diff options
context:
space:
mode:
authorThiago Jung Bauermann2019-06-11 08:28:10 +0200
committerMimi Zohar2019-06-14 15:02:44 +0200
commite038f5f691e003af25cda0f1593d2cc0a4d1c866 (patch)
treefe7b9aef19152e189f80e905e75c8f6519c646ac /security/integrity/ima/ima_init.c
parentima: use the lsm policy update notifier (diff)
downloadkernel-qcow2-linux-e038f5f691e003af25cda0f1593d2cc0a4d1c866.tar.gz
kernel-qcow2-linux-e038f5f691e003af25cda0f1593d2cc0a4d1c866.tar.xz
kernel-qcow2-linux-e038f5f691e003af25cda0f1593d2cc0a4d1c866.zip
ima: Use designated initializers for struct ima_event_data
Designated initializers allow specifying only the members of the struct that need initialization. Non-mentioned members are initialized to zero. This makes the code a bit clearer (particularly in ima_add_boot_aggregate) and also allows adding a new member to the struct without having to update all struct initializations. Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Diffstat (limited to 'security/integrity/ima/ima_init.c')
-rw-r--r--security/integrity/ima/ima_init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/integrity/ima/ima_init.c b/security/integrity/ima/ima_init.c
index 6c9295449751..ef6c3a26296e 100644
--- a/security/integrity/ima/ima_init.c
+++ b/security/integrity/ima/ima_init.c
@@ -49,8 +49,8 @@ static int __init ima_add_boot_aggregate(void)
const char *audit_cause = "ENOMEM";
struct ima_template_entry *entry;
struct integrity_iint_cache tmp_iint, *iint = &tmp_iint;
- struct ima_event_data event_data = {iint, NULL, boot_aggregate_name,
- NULL, 0, NULL};
+ struct ima_event_data event_data = { .iint = iint,
+ .filename = boot_aggregate_name };
int result = -ENOMEM;
int violation = 0;
struct {