]> xenbits.xensource.com Git - people/pauldu/xenvif.git/commitdiff
Cancel pending timers when rings are disabled
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 28 Jan 2016 14:35:53 +0000 (14:35 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Thu, 28 Jan 2016 14:42:59 +0000 (14:42 +0000)
No new timers can be scheduled once rings are disabled but if the rings are
both disconnected and destroyed within the next 100us then it's possible
that the DPC might hit some unitialized data so make sure pending timers
are cancelled.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenvif/receiver.c
src/xenvif/transmitter.c

index 538971e325ff6fc24b7b66b4d5dc08f3b32a2680..33904738ddeb7276c18bd089eb6b02559f490840 100644 (file)
@@ -2593,6 +2593,12 @@ __ReceiverRingDisable(
     Ring->Stopped = FALSE;
 
     __ReceiverRingReleaseLock(Ring);
+
+    //
+    // No new timers can be scheduled once Enabled goes to FALSE.
+    // Cancel any existing ones.
+    //
+    (VOID) KeCancelTimer(&Ring->Timer);
 }
 
 static FORCEINLINE VOID
index 3aa63660d1d2d80b23d4b9408cdcef7c99532624..5a70beaaae7b0fd91d1f0e5509cf259d3fd4f17f 100644 (file)
@@ -3698,6 +3698,12 @@ __TransmitterRingDisable(
     Ring->Enabled = FALSE;
 
     __TransmitterRingReleaseLock(Ring);
+
+    //
+    // No new timers can be scheduled once Enabled goes to FALSE.
+    // Cancel any existing ones.
+    //
+    (VOID) KeCancelTimer(&Ring->Timer);
 }
 
 static FORCEINLINE VOID