Message ID | 1456998223-12356-6-git-send-email-arei.gonglei@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 03/03/2016 10:43, Gonglei wrote: > fix CID 1351391. > > Signed-off-by: Gonglei <arei.gonglei@huawei.com> > --- > hw/ppc/spapr.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index e9d4abf..57d19ab 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -2221,6 +2221,10 @@ static void spapr_machine_device_plug(HotplugHandler *hotplug_dev, > if (*errp) { > return; > } > + if (node < 0 || node >= MAX_NODES) { > + error_setg(errp, "Invaild node %d", node); > + return; > + } > > /* > * Currently PowerPC kernel doesn't allow hot-adding memory to > Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index e9d4abf..57d19ab 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2221,6 +2221,10 @@ static void spapr_machine_device_plug(HotplugHandler *hotplug_dev, if (*errp) { return; } + if (node < 0 || node >= MAX_NODES) { + error_setg(errp, "Invaild node %d", node); + return; + } /* * Currently PowerPC kernel doesn't allow hot-adding memory to
fix CID 1351391. Signed-off-by: Gonglei <arei.gonglei@huawei.com> --- hw/ppc/spapr.c | 4 ++++ 1 file changed, 4 insertions(+)