spapr: ensure core_slot isn't NULL in spapr_core_unplug()
commit07572c0653a60769df406c16136e2cc9234692f5
authorGreg Kurz <groug@kaod.org>
Thu, 18 May 2017 13:58:31 +0000 (18 15:58 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 24 May 2017 01:39:53 +0000 (24 11:39 +1000)
treefc27bbe4479ab1c1c12100f996264d897847265c
parentde86eccc0c836adfa8dbb94848096720177f5ccb
spapr: ensure core_slot isn't NULL in spapr_core_unplug()

If we go that far on the path of hot-removing a core and we find out that
the core-id is invalid, then we have a serious bug.

Let's make it explicit with an assert() instead of dereferencing a NULL
pointer.

This fixes Coverity issue CID 1375404.

Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c