提交 d43b45e2 编写于 作者: D David Gibson 提交者: Alexander Graf

pseries: Fix initialization of sPAPREnvironment structure

Since we added PCI support to the pseries machine, we include a qlist of
PCI host bridges in the sPAPREnvironment structure.  However this list
was never properly initialized it.  Somehow we got away with this until
some other recent change broke it, and we now segfault immediately on
startup.

This patch adds the required QLIST_INIT(), and while we're at it makes sure
we initialize the rest of the sPAPREnvironment structure to 0, to avoid
future nasty surprises.
Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 0e3b800e
...@@ -407,7 +407,9 @@ static void ppc_spapr_init(ram_addr_t ram_size, ...@@ -407,7 +407,9 @@ static void ppc_spapr_init(ram_addr_t ram_size,
long pteg_shift = 17; long pteg_shift = 17;
char *filename; char *filename;
spapr = g_malloc(sizeof(*spapr)); spapr = g_malloc0(sizeof(*spapr));
QLIST_INIT(&spapr->phbs);
cpu_ppc_hypercall = emulate_spapr_hypercall; cpu_ppc_hypercall = emulate_spapr_hypercall;
/* Allocate RMA if necessary */ /* Allocate RMA if necessary */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册