wnaspi32: Call ASPI_GetNumControllers() only once.
This commit is contained in:
parent
a2a34bd80b
commit
084636c518
|
@ -308,6 +308,7 @@ ASPI_ExecScsiCmd(SRB_ExecSCSICmd *lpPRB)
|
||||||
WORD ret;
|
WORD ret;
|
||||||
DWORD status;
|
DWORD status;
|
||||||
int in_len, out_len;
|
int in_len, out_len;
|
||||||
|
int num_controllers = 0;
|
||||||
int error_code = 0;
|
int error_code = 0;
|
||||||
int fd;
|
int fd;
|
||||||
DWORD SRB_Status;
|
DWORD SRB_Status;
|
||||||
|
@ -343,9 +344,11 @@ ASPI_ExecScsiCmd(SRB_ExecSCSICmd *lpPRB)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ASPI_DebugPrintCmd(lpPRB);
|
ASPI_DebugPrintCmd(lpPRB);
|
||||||
if (lpPRB->SRB_HaId > ASPI_GetNumControllers()) {
|
|
||||||
ERR("Failed: Wanted hostadapter %d, but we have only %d.\n",
|
num_controllers = ASPI_GetNumControllers();
|
||||||
lpPRB->SRB_HaId,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 );
|
return WNASPI32_DoPosting( lpPRB, SS_INVALID_HA );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue