linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] scsi/bfa: off by one in bfa_ioc_mbox_isr()
@ 2010-06-21  6:45 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-06-21  6:45 UTC (permalink / raw)
  To: Jing Huang
  Cc: James E.J. Bottomley, Krishna Gudipati, linux-scsi,
	kernel-janitors

This should be ">=" here instead of ">" so that we don't read past the
end of the array.

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

diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index e038bc9..0ba624d 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -1595,7 +1595,7 @@ bfa_ioc_mbox_isr(struct bfa_ioc_s *ioc)
 		return;
 	}
 
-	if ((mc > BFI_MC_MAX) || (mod->mbhdlr[mc].cbfn == NULL))
+	if ((mc >= BFI_MC_MAX) || (mod->mbhdlr[mc].cbfn == NULL))
 		return;
 
 	mod->mbhdlr[mc].cbfn(mod->mbhdlr[mc].cbarg, &m);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-21  6:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-21  6:45 [patch] scsi/bfa: off by one in bfa_ioc_mbox_isr() Dan Carpenter

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).