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: 8252941 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 197BF9F1C1 for ; Mon, 8 Feb 2016 17:21:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6D586201EC for ; Mon, 8 Feb 2016 17:21:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE7B920034 for ; Mon, 8 Feb 2016 17:21:36 +0000 (UTC) Received: from localhost ([::1]:47080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSpVI-0008LF-4s for patchwork-qemu-devel@patchwork.kernel.org; Mon, 08 Feb 2016 12:21:36 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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;