Message ID | 1454950999-64128-28-git-send-email-pbonzini@redhat.com |
---|---|
State | Accepted |
Commit | 93a5364620dbfcf3cc13866d0e218fc3624c1edf |
Headers | show |
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;