Commit 084636c5 authored by Rok Mandeljc's avatar Rok Mandeljc Committed by Alexandre Julliard

wnaspi32: Call ASPI_GetNumControllers() only once.

parent a2a34bd8
......@@ -308,6 +308,7 @@ ASPI_ExecScsiCmd(SRB_ExecSCSICmd *lpPRB)
WORD ret;
DWORD status;
int in_len, out_len;
int num_controllers = 0;
int error_code = 0;
int fd;
DWORD SRB_Status;
......@@ -343,9 +344,11 @@ ASPI_ExecScsiCmd(SRB_ExecSCSICmd *lpPRB)
break;
}
ASPI_DebugPrintCmd(lpPRB);
if (lpPRB->SRB_HaId > ASPI_GetNumControllers()) {
ERR("Failed: Wanted hostadapter %d, but we have only %d.\n",
lpPRB->SRB_HaId,ASPI_GetNumControllers()
num_controllers = ASPI_GetNumControllers();
if (lpPRB->SRB_HaId > num_controllers) {
WARN("Failed: Wanted hostadapter %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