Skip to contentSkip to conversation

bfa: off by one in bfa_ioc_mbox_isr()

PATCH In review Dan Carpenter 1 participant 1 message Jul 6, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 bfa: off by one in bfa_ioc_mbox_isr()

If mc = BFI_MC_MAX then we're reading past the end of the mod->mbhdlr[] array.

drivers/scsi/bfa/bfa_ioc.c +1 -1
index d6c2bf3..052373b 100644
@@ -2378,7 +2378,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);