Commit 18cf1248 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

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: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarRasesh Mody <rmody@brocade.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 44861f44
...@@ -483,7 +483,7 @@ bfa_msgq_rspq_pi_update(struct bfa_msgq_rspq *rspq, struct bfi_mbmsg *mb) ...@@ -483,7 +483,7 @@ bfa_msgq_rspq_pi_update(struct bfa_msgq_rspq *rspq, struct bfi_mbmsg *mb)
mc = msghdr->msg_class; mc = msghdr->msg_class;
num_entries = ntohs(msghdr->num_entries); 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; break;
(rspq->rsphdlr[mc].cbfn)(rspq->rsphdlr[mc].cbarg, msghdr); (rspq->rsphdlr[mc].cbfn)(rspq->rsphdlr[mc].cbarg, msghdr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment