From: Paul Durrant Date: Thu, 28 Jan 2016 14:35:53 +0000 (+0000) Subject: Cancel pending timers when rings are disabled X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=07c7ba63893ddbb38711c8072503dfad7cec2e10;p=people%2Fpauldu%2Fxenvif.git Cancel pending timers when rings are disabled 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 --- diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c index 538971e..3390473 100644 --- a/src/xenvif/receiver.c +++ b/src/xenvif/receiver.c @@ -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 diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c index 3aa6366..5a70bea 100644 --- a/src/xenvif/transmitter.c +++ b/src/xenvif/transmitter.c @@ -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