summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2009-12-28 21:08:39 +0300
committerJames Bottomley <James.Bottomley@suse.de>2010-01-18 19:48:14 +0300
commit5d7ebb9c7a04d29efce1099024944dfd94d9f63c (patch)
tree55785299094a271f9a8b63ff6b4e46585d6a0521 /drivers/scsi
parent0ed8570ef4d51bb46e2028b2e3c3ddd1f860e193 (diff)
downloadlinux-5d7ebb9c7a04d29efce1099024944dfd94d9f63c.tar.xz
[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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/FlashPoint.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c
index b898d382b7b0..e40cdfb7541f 100644
--- a/drivers/scsi/FlashPoint.c
+++ b/drivers/scsi/FlashPoint.c
@@ -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];