diff options
author | Igor Mammedov <imammedo@redhat.com> | 2016-03-01 10:40:48 +0100 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:49:36 -0600 |
commit | 82655f52c01efc8ae0e29da9314bbae4d0678537 (patch) | |
tree | 889199fc22e2aafb71c3f6cf92f7fd8d52ca6767 /hw/intc | |
parent | b19df935f0a059bff37505ff0f86e9c1d52abfd0 (diff) | |
download | hqemu-82655f52c01efc8ae0e29da9314bbae4d0678537.zip hqemu-82655f52c01efc8ae0e29da9314bbae4d0678537.tar.gz |
pc-dimm: fix error handling in pc_dimm_check_memdev_is_busy()
If host_memory_backend_get_memory() were to return error and
NULL MemoryRegion, pc_dimm_check_memdev_is_busy() would crash
dereferencing NULL pointer in memory_region_is_mapped().
But if error is set and non NULL MemoryRegion is returned
then error_setg() will fail with "error already set" assertion
in error_setv()
To avoid above issues use typical error handling pattern
for property setters:
Error *local_error = NULL;
...
error_propagate(errp, local_err);
Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/intc')
0 files changed, 0 insertions, 0 deletions