提交 5d7ebb9c 编写于 作者: D Dan Carpenter 提交者: James Bottomley

[SCSI] FlashPoint: fix off by one tests

The check on MAX_SCSI_TAR should be >= instead of > or we could go past the
end of the array.

Joe Eykholt aslo correctly points out that the check on MAX_LUN should be
>= as well.  That matches with how it is used in the rest of the file.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
上级 0ed8570e
......@@ -3924,7 +3924,7 @@ static void FPT_sinits(struct sccb *p_sccb, unsigned char p_card)
{
struct sccb_mgr_tar_info *currTar_Info;
if ((p_sccb->TargID > MAX_SCSI_TAR) || (p_sccb->Lun > MAX_LUN)) {
if ((p_sccb->TargID >= MAX_SCSI_TAR) || (p_sccb->Lun >= MAX_LUN)) {
return;
}
currTar_Info = &FPT_sccbMgrTbl[p_card][p_sccb->TargID];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册