win-pvdrivers

changeset 597:1ca6f17ebc47

Allow for a NULL MapRegisterBase parameter in FreeMapRegisters
author James Harper <james.harper@bendigoit.com.au>
date Fri Jun 26 16:03:07 2009 +1000 (2009-06-26)
parents 214866b0a8fd
children cf954aa0a8b1
files xenpci/xenpci_pdo.c
line diff
     1.1 --- a/xenpci/xenpci_pdo.c	Fri Jun 26 14:45:54 2009 +1000
     1.2 +++ b/xenpci/xenpci_pdo.c	Fri Jun 26 16:03:07 2009 +1000
     1.3 @@ -266,6 +266,11 @@ XenPci_DOP_FreeMapRegisters(
     1.4    grant_ref_t gref;
     1.5  
     1.6    //FUNCTION_ENTER();
     1.7 +  if (!map_register_base)
     1.8 +  {
     1.9 +    /* i'm not sure if this is ideal here, but NDIS definitely does it */
    1.10 +    return;
    1.11 +  }
    1.12    ASSERT(map_register_base->total_map_registers == NumberOfMapRegisters);
    1.13  
    1.14    for (i = 0; i < map_register_base->count; i++)
    1.15 @@ -322,6 +327,7 @@ XenPci_DOP_MapTransfer(
    1.16    //  mdl, MapRegisterBase, MmGetMdlVirtualAddress(mdl), CurrentVa, *Length));
    1.17  
    1.18    ASSERT(mdl);
    1.19 +  ASSERT(map_register_base);
    1.20    ASSERT(map_register_base->count < map_register_base->total_map_registers);
    1.21    
    1.22    if (xen_dma_adapter->dma_extension)