bna: off by one in bfa_msgq_rspq_pi_update()

The rspq->rsphdlr[] array has BFI_MC_MAX elements, so this test was
off by one.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Dan Carpenter 2011-08-24 01:30:28 +00:00 committed by David S. Miller
parent 44861f4455
commit 18cf1248ec

View File

@ -483,7 +483,7 @@ bfa_msgq_rspq_pi_update(struct bfa_msgq_rspq *rspq, struct bfi_mbmsg *mb)
mc = msghdr->msg_class;
num_entries = ntohs(msghdr->num_entries);
if ((mc > BFI_MC_MAX) || (rspq->rsphdlr[mc].cbfn == NULL))
if ((mc >= BFI_MC_MAX) || (rspq->rsphdlr[mc].cbfn == NULL))
break;
(rspq->rsphdlr[mc].cbfn)(rspq->rsphdlr[mc].cbarg, msghdr);