mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
[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>
This commit is contained in:
parent
2b48aed182
commit
1377d8dd7e
1 changed files with 1 additions and 1 deletions
|
@ -1499,7 +1499,7 @@ static void FlashPoint_StartCCB(unsigned long pCurrCard, struct sccb *p_Sccb)
|
||||||
thisCard = ((struct sccb_card *)pCurrCard)->cardIndex;
|
thisCard = ((struct sccb_card *)pCurrCard)->cardIndex;
|
||||||
ioport = ((struct sccb_card *)pCurrCard)->ioPort;
|
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->HostStatus = SCCB_COMPLETE;
|
||||||
p_Sccb->SccbStatus = SCCB_ERROR;
|
p_Sccb->SccbStatus = SCCB_ERROR;
|
||||||
|
|
Loading…
Reference in a new issue