]> git.proxmox.com Git - mirror_qemu.git/commit
spapr_rtas: Prevent QEMU crash during hotplug without a prior device_add
authorBharata B Rao <bharata@linux.vnet.ibm.com>
Mon, 31 Aug 2015 23:53:52 +0000 (09:53 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 23 Sep 2015 00:51:09 +0000 (10:51 +1000)
commite6fc9568c865f2f81499475a4e322cd563fdfd90
tree7ddd4c2bf817ccfe12d5c3213d06777e97429e38
parentaaf87c6616370685a7cff6a21616fc5db7495014
spapr_rtas: Prevent QEMU crash during hotplug without a prior device_add

If drmgr is used in the guest to hotplug a device before a device_add
has been issued via the QEMU monitor, QEMU segfaults in configure_connector
call. This occurs due to accessing of NULL FDT which otherwise would have
been created and associated with the DRC during device_add command.

Check for NULL FDT and return failure from configure_connector call.
As per PAPR+, an error value of -9003 seems appropriate for this failure.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_rtas.c
include/hw/ppc/spapr_drc.h