]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
Don't assume EventPageMdl has been allocated...
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 30 Nov 2017 10:11:42 +0000 (10:11 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Thu, 30 Nov 2017 16:26:20 +0000 (16:26 +0000)
...when calling EvtchnFifoContract()

The allocation is deferred until at least one event channel is allocated,
but EvtchnFifoContract() is called from EvtchnFifoRelease()n which can be
called before that happens.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenbus/evtchn_fifo.c

index c0456e0572f3870bf772fb4c6010ea44fcc4c86f..b8be93b68688be3e6593ec2950e5ab645bbb5142 100644 (file)
@@ -272,7 +272,8 @@ EvtchnFifoContract(
         __FreePage(Mdl);
     }
 
-    __EvtchnFifoFree(Context->EventPageMdl);
+    if (Context->EventPageMdl != NULL)
+        __EvtchnFifoFree(Context->EventPageMdl);
 
     Context->EventPageMdl = NULL;
     Context->EventPageCount = 0;