bna: off by one in bfa_msgq_rspq_pi_update()
PATCH 1/1 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 <[email protected]>
drivers/net/ethernet/brocade/bna/bfa_msgq.c +1 -1
@@ -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);
Quoted 22 lines
From: Dan Carpenter [mailto:[email protected]]
Sent: Wednesday, August 24, 2011 4:30 AMThe rspq->rsphdlr[] array has
BFI_MC_MAXelements, so this test was off by one.Signed-off-by Dan Carpenter <[email protected]>drivers/net/ethernet/brocade/bna/bfa_msgq.c +1
-1@@ -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 ;
Quoted 1 line
(rspq->rsphdlr[mc].cbfn)(rspq->rsphdlr[mc].cbarg, msghdr);
Acked-by Rasesh Mody <[email protected]>
Thanks,
Rasesh
From: Dan Carpenter <[email protected]>
Date: Wed, 24 Aug 2011 14:30:28 +0300
Quoted 4 lines
The rspq->rsphdlr[] array has
BFI_MC_MAXelements, so this test was off by one.Signed-off-by Dan Carpenter <[email protected]>
Applied.