Skip to content

Commit

Permalink
spapr: fix write-past-end-of-array error in cpu core device init code
Browse files Browse the repository at this point in the history
This fixes a potential QEMU crash introduced by commit 3b54254.

Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  • Loading branch information
gkurz authored and dgibson committed Jun 30, 2016
1 parent 6cc09e2 commit dde35bc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions hw/ppc/spapr_cpu_core.c
Expand Up @@ -309,10 +309,9 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error **errp)
}

err:
while (i >= 0) {
while (--i >= 0) {
obj = sc->threads + i * size;
object_unparent(obj);
i--;
}
g_free(sc->threads);
error_propagate(errp, local_err);
Expand Down

0 comments on commit dde35bc

Please sign in to comment.