]> git.proxmox.com Git - mirror_qemu.git/commit
memory-device: Fix memory pre-plug error API violations
authorMarkus Armbruster <armbru@redhat.com>
Wed, 4 Dec 2019 09:36:17 +0000 (10:36 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 18 Dec 2019 07:36:15 +0000 (08:36 +0100)
commit8574c9f1ad905e473593230308a0b2a68c46ebe3
treea738cb98df766882d975826b31a9a012d630f850
parent292743d976324004d0c4f6f08e6d0589679d40ea
memory-device: Fix memory pre-plug error API violations

memory_device_get_free_addr() dereferences @errp when
memory_device_check_addable() fails.  That's wrong; see the big
comment in error.h.  Introduced in commit 1b6d6af21b "pc-dimm: factor
out capacity and slot checks into MemoryDevice".

No caller actually passes null.

Fix anyway: splice in a local Error *err, and error_propagate().

Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20191204093625.14836-11-armbru@redhat.com>
hw/mem/memory-device.c