integrity: Avoid -Wflex-array-member-not-at-end warnings
[linux-2.6-block.git] / security / integrity / ima / ima_api.c
index 1856981e33df3bbbccfcd278bb4ce42f6f13e1b3..3d286de231e1d5e373cc7029d1372e9e1ddbf043 100644 (file)
@@ -246,6 +246,8 @@ int ima_collect_measurement(struct ima_iint_cache *iint, struct file *file,
        struct inode *inode = file_inode(file);
        struct inode *real_inode = d_real_inode(file_dentry(file));
        struct ima_max_digest_data hash;
+       struct ima_digest_data *hash_hdr = container_of(&hash.hdr,
+                                               struct ima_digest_data, hdr);
        struct name_snapshot filename;
        struct kstat stat;
        int result = 0;
@@ -286,9 +288,9 @@ int ima_collect_measurement(struct ima_iint_cache *iint, struct file *file,
                        result = -ENODATA;
                }
        } else if (buf) {
-               result = ima_calc_buffer_hash(buf, size, &hash.hdr);
+               result = ima_calc_buffer_hash(buf, size, hash_hdr);
        } else {
-               result = ima_calc_file_hash(file, &hash.hdr);
+               result = ima_calc_file_hash(file, hash_hdr);
        }
 
        if (result && result != -EBADF && result != -EINVAL)