From 18cf1248eca3f1fc38e12b314a6cadd286260e65 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 24 Aug 2011 01:30:28 +0000 Subject: [PATCH] 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 Acked-by: Rasesh Mody Signed-off-by: David S. Miller --- drivers/net/ethernet/brocade/bna/bfa_msgq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/brocade/bna/bfa_msgq.c b/drivers/net/ethernet/brocade/bna/bfa_msgq.c index ed5218782787..dd36427f4752 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_msgq.c +++ b/drivers/net/ethernet/brocade/bna/bfa_msgq.c @@ -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); -- 2.30.2