Commit 47d1fee7 authored by Rok Mandeljc's avatar Rok Mandeljc Committed by Alexandre Julliard

wnaspi32: Fix controller number validation.

parent 3a59ac08
......@@ -109,7 +109,7 @@ ASPI_OpenDevice(SRB_ExecSCSICmd *prb)
}
LeaveCriticalSection(&ASPI_CritSection);
if (prb->SRB_HaId > ASPI_GetNumControllers())
if (prb->SRB_HaId >= ASPI_GetNumControllers())
return -1;
hc = ASPI_GetHCforController( prb->SRB_HaId );
......@@ -314,8 +314,8 @@ ASPI_ExecScsiCmd(SRB_ExecSCSICmd *lpPRB)
DWORD SRB_Status;
num_controllers = ASPI_GetNumControllers();
if (lpPRB->SRB_HaId > num_controllers) {
WARN("Failed: Wanted hostadapter %d, but we have only %d.\n",
if (lpPRB->SRB_HaId >= num_controllers) {
WARN("Failed: Wanted hostadapter with index %d, but we have only %d.\n",
lpPRB->SRB_HaId, num_controllers
);
return WNASPI32_DoPosting( lpPRB, SS_INVALID_HA );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment