Skip to content

Commit 5d7ebb9

Browse files
error27James Bottomley
authored andcommitted
[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: Dan Carpenter <error27@gmail.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
1 parent 0ed8570 commit 5d7ebb9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/scsi/FlashPoint.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3924,7 +3924,7 @@ static void FPT_sinits(struct sccb *p_sccb, unsigned char p_card)
39243924
{
39253925
struct sccb_mgr_tar_info *currTar_Info;
39263926

3927-
if ((p_sccb->TargID > MAX_SCSI_TAR) || (p_sccb->Lun > MAX_LUN)) {
3927+
if ((p_sccb->TargID >= MAX_SCSI_TAR) || (p_sccb->Lun >= MAX_LUN)) {
39283928
return;
39293929
}
39303930
currTar_Info = &FPT_sccbMgrTbl[p_card][p_sccb->TargID];

0 commit comments

Comments
 (0)