Commit 1161d0e1 authored by Rok Mandeljc's avatar Rok Mandeljc Committed by Alexandre Julliard

wnaspi32: Do the command dumping only after device has been verified.

parent 084636c5
......@@ -313,6 +313,18 @@ ASPI_ExecScsiCmd(SRB_ExecSCSICmd *lpPRB)
int fd;
DWORD SRB_Status;
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 );
}
fd = ASPI_OpenDevice(lpPRB);
if (fd == -1) {
return WNASPI32_DoPosting( lpPRB, SS_NO_DEVICE );
}
/* FIXME: hackmode */
#define MAKE_TARGET_TO_HOST(lpPRB) \
if (!TARGET_TO_HOST(lpPRB)) { \
......@@ -345,18 +357,6 @@ ASPI_ExecScsiCmd(SRB_ExecSCSICmd *lpPRB)
}
ASPI_DebugPrintCmd(lpPRB);
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 );
}
fd = ASPI_OpenDevice(lpPRB);
if (fd == -1) {
return WNASPI32_DoPosting( lpPRB, SS_NO_DEVICE );
}
sg_hd = NULL;
sg_reply_hdr = NULL;
......
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