netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch -next] bna: off by one in bfa_msgq_rspq_pi_update()
@ 2011-08-24 11:30 Dan Carpenter
  2011-08-24 17:33 ` Rasesh Mody
  2011-08-26 16:51 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2011-08-24 11:30 UTC (permalink / raw)
  To: Rasesh Mody
  Cc: Debashis Dutt, open list:BROCADE BNA 10 GI..., kernel-janitors

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

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/net/ethernet/brocade/bna/bfa_msgq.c b/drivers/net/ethernet/brocade/bna/bfa_msgq.c
index ed52187..dd36427 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);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-26 16:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-24 11:30 [patch -next] bna: off by one in bfa_msgq_rspq_pi_update() Dan Carpenter
2011-08-24 17:33 ` Rasesh Mody
2011-08-26 16:51 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).