Commit 1a5512bb authored by Gonglei's avatar Gonglei Committed by Paolo Bonzini
Browse files

spapr: fix possible Negative array index read



fix CID 1351391.

Signed-off-by: default avatarGonglei <arei.gonglei@huawei.com>
Message-Id: <1456998223-12356-6-git-send-email-arei.gonglei@huawei.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent dacca04c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2208,6 +2208,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