aboutsummaryrefslogtreecommitdiff
path: root/hw/mem
diff options
context:
space:
mode:
Diffstat (limited to 'hw/mem')
-rw-r--r--hw/mem/memory-device.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/mem/memory-device.c b/hw/mem/memory-device.c
index aef148c1d7..4bc9cf0917 100644
--- a/hw/mem/memory-device.c
+++ b/hw/mem/memory-device.c
@@ -99,6 +99,7 @@ static uint64_t memory_device_get_free_addr(MachineState *ms,
uint64_t align, uint64_t size,
Error **errp)
{
+ Error *err = NULL;
GSList *list = NULL, *item;
Range as, new = range_empty;
@@ -123,8 +124,9 @@ static uint64_t memory_device_get_free_addr(MachineState *ms,
return 0;
}
- memory_device_check_addable(ms, size, errp);
- if (*errp) {
+ memory_device_check_addable(ms, size, &err);
+ if (err) {
+ error_propagate(errp, err);
return 0;
}