summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/FlashPoint.c
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-04-23 11:51:10 +0200
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-27 19:19:55 +0200
commit1377d8dd7e1b5526637958aabb5427bbee5a68d7 (patch)
treeed545c51f083c8470830b008ea71fd5f2454b643 /drivers/scsi/FlashPoint.c
parent[SCSI] aic7xxx: Update type check in aicasm grammar (diff)
downloadlinux-1377d8dd7e1b5526637958aabb5427bbee5a68d7.tar.xz
linux-1377d8dd7e1b5526637958aabb5427bbee5a68d7.zip
[SCSI] FlashPoint: fix off-by-one errors
This patch fixes off-by-one errors in error checks (the variables are used as array indexes for arrays with MAX_SCSI_TAR resp. MAX_LUN elements) spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/FlashPoint.c')
-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 b374e457e5e2..b898d382b7b0 100644
--- a/drivers/scsi/FlashPoint.c
+++ b/drivers/scsi/FlashPoint.c
@@ -1499,7 +1499,7 @@ static void FlashPoint_StartCCB(unsigned long pCurrCard, struct sccb *p_Sccb)
thisCard = ((struct sccb_card *)pCurrCard)->cardIndex;
ioport = ((struct sccb_card *)pCurrCard)->ioPort;
- if ((p_Sccb->TargID > MAX_SCSI_TAR) || (p_Sccb->Lun > MAX_LUN)) {
+ if ((p_Sccb->TargID >= MAX_SCSI_TAR) || (p_Sccb->Lun >= MAX_LUN)) {
p_Sccb->HostStatus = SCCB_COMPLETE;
p_Sccb->SccbStatus = SCCB_ERROR;