win-pvdrivers

changeset 1021:6547b07f3236

Fix nasty truncation error in xenvbd
author James Harper <james.harper@bendigoit.com.au>
date Wed Feb 13 23:37:17 2013 +1100 (2013-02-13)
parents 2cbbfed14af4
children cd72cd0e1c19
files xenvbd_common/common_xen.h
line diff
     1.1 --- a/xenvbd_common/common_xen.h	Tue Feb 12 20:48:34 2013 +1100
     1.2 +++ b/xenvbd_common/common_xen.h	Wed Feb 13 23:37:17 2013 +1100
     1.3 @@ -46,7 +46,7 @@ XenVbd_Connect(PXENVBD_DEVICE_DATA xvdd,
     1.4    if (!xvdd->sring) {
     1.5      return STATUS_UNSUCCESSFUL;
     1.6    }
     1.7 -  pfn = (PFN_NUMBER)MmGetPhysicalAddress(xvdd->sring).QuadPart >> PAGE_SHIFT;
     1.8 +  pfn = (PFN_NUMBER)(MmGetPhysicalAddress(xvdd->sring).QuadPart >> PAGE_SHIFT);
     1.9    xvdd->sring_gref = XnGrantAccess(xvdd->handle, (ULONG)pfn, FALSE, INVALID_GRANT_REF, xvdd->grant_tag);
    1.10    SHARED_RING_INIT(xvdd->sring);
    1.11    FRONT_RING_INIT(&xvdd->ring, xvdd->sring, PAGE_SIZE);
    1.12 @@ -151,7 +151,6 @@ static NTSTATUS
    1.13  XenVbd_Disconnect(PVOID DeviceExtension, BOOLEAN suspend) {
    1.14    NTSTATUS status;
    1.15    PXENVBD_DEVICE_DATA xvdd = (PXENVBD_DEVICE_DATA)DeviceExtension;
    1.16 -  PFN_NUMBER pfn;
    1.17  
    1.18    if (xvdd->device_state == DEVICE_STATE_INACTIVE) {
    1.19      /* state stays INACTIVE */
    1.20 @@ -177,7 +176,6 @@ XenVbd_Disconnect(PVOID DeviceExtension,
    1.21      KeWaitForSingleObject(&xvdd->backend_event, Executive, KernelMode, FALSE, NULL);
    1.22    }
    1.23    XnUnbindEvent(xvdd->handle, xvdd->event_channel);
    1.24 -  pfn = (PFN_NUMBER)MmGetPhysicalAddress(xvdd->sring).QuadPart >> PAGE_SHIFT;
    1.25    XnEndAccess(xvdd->handle, xvdd->sring_gref, FALSE, xvdd->grant_tag);
    1.26    ExFreePoolWithTag(xvdd->sring, XENVBD_POOL_TAG);
    1.27