diff options
-rw-r--r-- | MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c index 3298b95769..93b7f715e1 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c @@ -2776,6 +2776,7 @@ Returns: Status = EFI_SUCCESS;
Tcb = NULL;
TimeoutEvent = NULL;
+ Timeout = 0;
if (Session->State != SESSION_STATE_LOGGED_IN) {
return EFI_DEVICE_ERROR;
@@ -2790,15 +2791,6 @@ Returns: if (Packet->Timeout != 0) {
Timeout = MultU64x32 (Packet->Timeout, 2);
- //
- // Start the timeout timer.
- //
- Status = gBS->SetTimer (Conn->TimeoutEvent, TimerRelative, Timeout);
- if (EFI_ERROR (Status)) {
- goto ON_EXIT;
- }
-
- TimeoutEvent = Conn->TimeoutEvent;
}
Status = IScsiNewTcb (Conn, &Tcb);
@@ -2855,6 +2847,16 @@ Returns: while (!Tcb->StatusXferd) {
//
+ // Start the timeout timer.
+ //
+ if (Timeout) {
+ Status = gBS->SetTimer (Conn->TimeoutEvent, TimerRelative, Timeout);
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ TimeoutEvent = Conn->TimeoutEvent;
+ }
+ //
// try to receive PDU from target.
//
Status = IScsiReceivePdu (Conn, &Pdu, &InBufferContext, FALSE, FALSE, TimeoutEvent);
|