Skip to content

Commit

Permalink
bna: off by one in bfa_msgq_rspq_pi_update()
Browse files Browse the repository at this point in the history
The rspq->rsphdlr[] array has BFI_MC_MAX elements, so this test was
off by one.

Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Rasesh Mody <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
error27 authored and davem330 committed Aug 26, 2011
1 parent 44861f4 commit 18cf124
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/brocade/bna/bfa_msgq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 18cf124

Please sign in to comment.