From patchwork Mon Feb 8 17:03:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 61421 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1564188lbl; Mon, 8 Feb 2016 09:21:56 -0800 (PST) X-Received: by 10.55.80.68 with SMTP id e65mr36006118qkb.46.1454952116458; Mon, 08 Feb 2016 09:21:56 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y63si31311634qhy.0.2016.02.08.09.21.56 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 08 Feb 2016 09:21:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dkim=fail header.i=@gmail.com Received: from localhost ([::1]:47081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSpVb-0000At-Vj for patch@linaro.org; Mon, 08 Feb 2016 12:21:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSpEG-0003yx-O1 for qemu-devel@nongnu.org; Mon, 08 Feb 2016 12:04:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSpEE-0006vh-Sl for qemu-devel@nongnu.org; Mon, 08 Feb 2016 12:04:00 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:33893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSpEE-0006vZ-Lu for qemu-devel@nongnu.org; Mon, 08 Feb 2016 12:03:58 -0500 Received: by mail-wm0-x22e.google.com with SMTP id 128so163740493wmz.1 for ; Mon, 08 Feb 2016 09:03:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=/62DSTXN/70jDbO3P9gelVHi0wcXnfU0uZwhXfqa1HU=; b=KL7/kVIHfX9fTh0hT7I723qnayKOaW1Xm+BoS2pBW+iUgv7StyCm5CgsU20csZ2ozI nWK8UrHDyRWNIaBiGk+4EYKVIg6mJ+O+nNjk/3UfbZ6E4bf/lwHMW7T6edbyUXG8Vv4z t14OX1aIgxRRoMx9eopm0ReQtQgsMR07Nsjjyiab6koAggYtuR5n/JqsBm4wWCT+ueNy e9Uek0CYIQRvoDO+r+CBgxzwBmzFR5qQEvVSDtLJC0BX78hyEBfByIxfxUzS8rKi0Exp UyND1JIaL3BNt4Bjv5rcxPqJWZ1mbrj17eP+XCQp6s5piNHq2AHYY+HGXMuJqElt7Hyt 1bmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=/62DSTXN/70jDbO3P9gelVHi0wcXnfU0uZwhXfqa1HU=; b=OC1Clej/X1Lks5SowKifB5CVm/9ZC0LwYQzRK+hu4haqqmLSRUYRwQp2YGnhRNSzNf mNsyChCLQ+MgZpNEs7nkVm3Xq2ZvC+Bc/itiPlaD0c3zT3EjlAyjaSsGhwaUou9SEtvw H5FvTYeh9cxhVrx4s65S+vyPHJE4RK6aO/yYl0uGG5qnGNKBKUbDbm1UwmabCAmKdEop fYxEVDhkEgKHxC3g2cc915i/8LaI5etVfKXpRJqkkLv9g6w9WCNrvaB0Il3k8oOj6ZCB xu7QjICPdQvBWk21BrpJfK+0OBrtrTpSlCEiu9Lo5WmdABeywFkI5MfAb+TyEmVzLaRe Y1dw== X-Gm-Message-State: AG10YOTpxOq3IzGj6cuhF40XSL8D9bR6oZYSnW+WJLMbC7DV2DV/taMexra2PiqGXj0n4A== X-Received: by 10.28.107.140 with SMTP id a12mr30921157wmi.77.1454951037964; Mon, 08 Feb 2016 09:03:57 -0800 (PST) Received: from 640k.lan (94-39-141-130.adsl-ull.clienti.tiscali.it. [94.39.141.130]) by smtp.gmail.com with ESMTPSA id b1sm30651442wjy.0.2016.02.08.09.03.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2016 09:03:57 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 8 Feb 2016 18:03:18 +0100 Message-Id: <1454950999-64128-28-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1454950999-64128-1-git-send-email-pbonzini@redhat.com> References: <1454950999-64128-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22e Cc: Peter Maydell , Xiao Guangrong , Corey Minyard , "Michael S. Tsirkin" , Stefan Hajnoczi , Shannon Zhao Subject: [Qemu-devel] [PULL 27/28] ipmi_bmc_sim: Fix off by one in check. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Corey Minyard Found by Paolo. Cc: Paolo Bonzini Cc: Michael S. Tsirkin Cc: Peter Maydell Cc: Shannon Zhao Cc: Xiao Guangrong Cc: Stefan Hajnoczi Signed-off-by: Corey Minyard Message-Id: <1452519152-6500-2-git-send-email-minyard@acm.org> Signed-off-by: Paolo Bonzini --- hw/ipmi/ipmi_bmc_sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.8.3.1 diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index e1ad19b..b3796af 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -559,7 +559,7 @@ static void ipmi_init_sensors_from_sdrs(IPMIBmcSim *s) static int ipmi_register_netfn(IPMIBmcSim *s, unsigned int netfn, const IPMINetfn *netfnd) { - if ((netfn & 1) || (netfn > MAX_NETFNS) || (s->netfns[netfn / 2])) { + if ((netfn & 1) || (netfn >= MAX_NETFNS) || (s->netfns[netfn / 2])) { return -1; } s->netfns[netfn / 2] = netfnd;