aboutsummaryrefslogtreecommitdiff
path: root/hw/ipmi
diff options
context:
space:
mode:
authorCorey Minyard <cminyard@mvista.com>2016-01-11 07:32:31 -0600
committerPaolo Bonzini <pbonzini@redhat.com>2016-02-09 15:46:54 +0100
commit93a5364620dbfcf3cc13866d0e218fc3624c1edf (patch)
tree0436dcca5dfa1b02cb7751589adb0bdfd40a8f43 /hw/ipmi
parentac5e8acdaec7c3a97d460e76ea912fa8ea7a4570 (diff)
downloadqemu-93a5364620dbfcf3cc13866d0e218fc3624c1edf.zip
qemu-93a5364620dbfcf3cc13866d0e218fc3624c1edf.tar.gz
qemu-93a5364620dbfcf3cc13866d0e218fc3624c1edf.tar.bz2
ipmi_bmc_sim: Fix off by one in check.
Found by Paolo. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Shannon Zhao <zhaoshenglong@huawei.com> Cc: Xiao Guangrong <guangrong.xiao@linux.intel.com> Cc: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Corey Minyard <cminyard@mvista.com> Message-Id: <1452519152-6500-2-git-send-email-minyard@acm.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/ipmi')
-rw-r--r--hw/ipmi/ipmi_bmc_sim.c2
1 files changed, 1 insertions, 1 deletions
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;