diff options
author | Haozhong Zhang <haozhong.zhang@intel.com> | 2015-12-25 10:57:42 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-01-08 16:01:37 +0200 |
commit | c8e6c93857885a19e959ec622d92a256d1cd98eb (patch) | |
tree | 02234086ab1e1e2a18fbaf014195ae9fdd084eb9 /hw/pci-host/piix.c | |
parent | 6bb9ead762bf749af11ea225fc2a74db1b93c105 (diff) |
nvdimm: fix header pointer in nvdimm_build_nfit()
In the current nvdimm_build_nfit(), the pointer 'header' initially equals
to table_data->data + table_data->len. However, the following
g_array_append_vals(table_data, structures->data, structures->len)
may resize and relocate table_data->data[]. Therefore, the usage of 'header'
afterwards may be illegal.
This patch fixes this issue by storing an offset within table_data->data[]
(rather than an address) in 'header'.
Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci-host/piix.c')
0 files changed, 0 insertions, 0 deletions