[Spice-devel] [PATCH 2/3] Fix memory leak: deleting primary surface device bitmap when it is disabled.

Yonit Halperin yhalperi at redhat.com
Mon Jul 12 02:15:16 PDT 2010


The bug caused BSOD: SESSION_HAS_VALID_POOL_ON_EXIT on switching users/log off
(after the driver is disabled and enabled back again, while the miniport is not restarted).
---
 display/driver.c |   10 +---------
 display/qxldd.h  |    3 ---
 2 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/display/driver.c b/display/driver.c
index 39d0aa9..7dce00e 100644
--- a/display/driver.c
+++ b/display/driver.c
@@ -929,23 +929,15 @@ VOID DrvDisableSurface(DHPDEV in_pdev)
     DEBUG_PRINT((NULL, 1, "%s: 0x%lx\n", __FUNCTION__, pdev));
 
     DisableQXLPrimarySurface(pdev);
-    //DisableQXLAllSurfaces(pdev);
 
     UnmapFB(pdev);
 
     if (pdev->surf) {
         DeleteDeviceBitmap(pdev, 0, DEVICE_BITMAP_ALLOCATION_TYPE_SURF0);
+        EngDeleteSurface(pdev->surf);
         pdev->surf = NULL;
     }
 
-    if (pdev->draw_surf) {
-        drawarea.bitmap = pdev->draw_bitmap;
-        drawarea.surf_obj = pdev->draw_surf;
-        FreeDrawArea(&drawarea);
-        pdev->draw_surf = NULL;
-        pdev->draw_bitmap = NULL;
-    }
-
     if (pdev->surfaces_info) {
         EngFreeMem(pdev->surfaces_info);
         pdev->surfaces_info = NULL;
diff --git a/display/qxldd.h b/display/qxldd.h
index 86438fe..ffa8b8c 100644
--- a/display/qxldd.h
+++ b/display/qxldd.h
@@ -242,9 +242,6 @@ typedef struct PDev {
     PEVENT cursor_event;
     PEVENT sleep_event;
 
-    HSURF draw_bitmap;
-    SURFOBJ *draw_surf;
-
     UINT32 log_port;
     UINT8 *log_buf;
     UINT32 *log_level;
-- 
1.6.6.1



More information about the Spice-devel mailing list