[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/5] spapr: Assert DIMM unplug state in spapr_memory_unplug()
From: |
David Gibson |
Subject: |
[PULL 3/5] spapr: Assert DIMM unplug state in spapr_memory_unplug() |
Date: |
Wed, 31 Mar 2021 17:25:22 +1100 |
From: Greg Kurz <groug@kaod.org>
spapr_memory_unplug() is the last step of the hot unplug sequence.
It is indirectly called by:
spapr_lmb_release()
hotplug_handler_unplug()
and spapr_lmb_release() already buys us that DIMM unplug state is
present : it gets restored with spapr_recover_pending_dimm_state()
if missing.
g_assert() that spapr_pending_dimm_unplugs_find() cannot return NULL
in spapr_memory_unplug() to make this clear and silence Coverity.
Fixes: Coverity CID 1450767
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <161562021166.948373.15092876234470478331.stgit@bahia.lan>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/spapr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index d56418ca29..73a06df3b1 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3660,6 +3660,9 @@ static void spapr_memory_unplug(HotplugHandler
*hotplug_dev, DeviceState *dev)
SpaprMachineState *spapr = SPAPR_MACHINE(hotplug_dev);
SpaprDimmState *ds = spapr_pending_dimm_unplugs_find(spapr, PC_DIMM(dev));
+ /* We really shouldn't get this far without anything to unplug */
+ g_assert(ds);
+
pc_dimm_unplug(PC_DIMM(dev), MACHINE(hotplug_dev));
qdev_unrealize(dev);
spapr_pending_dimm_unplugs_remove(spapr, ds);
--
2.30.2
- [PULL 0/5] ppc-for-6.0 queue 20210331, David Gibson, 2021/03/31
- [PULL 2/5] target/ppc/kvm: Cache timebase frequency, David Gibson, 2021/03/31
- [PULL 1/5] hw/ppc: e500: Add missing #address-cells and #size-cells in the eTSEC node, David Gibson, 2021/03/31
- [PULL 3/5] spapr: Assert DIMM unplug state in spapr_memory_unplug(),
David Gibson <=
- [PULL 4/5] spapr: Fix typo in the patb_entry comment, David Gibson, 2021/03/31
- [PULL 5/5] hw/net: fsl_etsec: Tx padding length should exclude CRC, David Gibson, 2021/03/31
- Re: [PULL 0/5] ppc-for-6.0 queue 20210331, Peter Maydell, 2021/03/31