integrity: Avoid -Wflex-array-member-not-at-end warnings
[linux-2.6-block.git] / security / integrity / ima / ima_init.c
index 393f5c7912d532e483cfae147df270ada5223609..4e208239a40e24cb6108f774a7cb7a53626087a5 100644 (file)
@@ -48,12 +48,14 @@ static int __init ima_add_boot_aggregate(void)
        struct ima_event_data event_data = { .iint = iint,
                                             .filename = boot_aggregate_name };
        struct ima_max_digest_data hash;
+       struct ima_digest_data *hash_hdr = container_of(&hash.hdr,
+                                               struct ima_digest_data, hdr);
        int result = -ENOMEM;
        int violation = 0;
 
        memset(iint, 0, sizeof(*iint));
        memset(&hash, 0, sizeof(hash));
-       iint->ima_hash = &hash.hdr;
+       iint->ima_hash = hash_hdr;
        iint->ima_hash->algo = ima_hash_algo;
        iint->ima_hash->length = hash_digest_size[ima_hash_algo];
 
@@ -70,7 +72,7 @@ static int __init ima_add_boot_aggregate(void)
         * is not found.
         */
        if (ima_tpm_chip) {
-               result = ima_calc_boot_aggregate(&hash.hdr);
+               result = ima_calc_boot_aggregate(hash_hdr);
                if (result < 0) {
                        audit_cause = "hashing_error";
                        goto err_out;