win-pvdrivers

changeset 673:e5522de3be37

Fix a problem where a zero length sg buffer might be present
author James Harper <james.harper@bendigoit.com.au>
date Wed Oct 07 14:16:21 2009 +1100 (2009-10-07)
parents 63b0eb3f9d44
children 27ac5655ce9a
files xenpci/xenbus.c xenpci/xenpci_pdo.c
line diff
     1.1 --- a/xenpci/xenbus.c	Wed Oct 07 14:16:01 2009 +1100
     1.2 +++ b/xenpci/xenbus.c	Wed Oct 07 14:16:21 2009 +1100
     1.3 @@ -372,6 +372,7 @@ XenBus_Init(PXENPCI_DEVICE_DATA xpdd)
     1.4    status = XenBus_Connect(xpdd);
     1.5    if (!NT_SUCCESS(status))
     1.6    {
     1.7 +    FUNCTION_EXIT();
     1.8      return status;
     1.9    }
    1.10    
     2.1 --- a/xenpci/xenpci_pdo.c	Wed Oct 07 14:16:01 2009 +1100
     2.2 +++ b/xenpci/xenpci_pdo.c	Wed Oct 07 14:16:21 2009 +1100
     2.3 @@ -695,7 +695,7 @@ XenPci_DOP_BuildScatterGatherListButDont
     2.4          mdl_start_va = CurrentVa;
     2.5        }
     2.6        mdl_byte_count = min(mdl_byte_count, total_remaining);
     2.7 -      if (active)
     2.8 +      if (active && mdl_byte_count)
     2.9        {
    2.10          sglist->NumberOfElements += ADDRESS_AND_SIZE_TO_SPAN_PAGES(
    2.11            mdl_start_va, mdl_byte_count);
    2.12 @@ -734,7 +734,7 @@ XenPci_DOP_BuildScatterGatherListButDont
    2.13          mdl_byte_count -= (ULONG)((UINT_PTR)CurrentVa - (UINT_PTR)mdl_start_va);
    2.14          mdl_start_va = CurrentVa;
    2.15        }
    2.16 -      if (active)
    2.17 +      if (active && mdl_byte_count)
    2.18        {
    2.19          ULONG pfn_offset;
    2.20          remaining = min(mdl_byte_count, total_remaining);