[Spice-devel] [PATCH] qxl:fix double free surface when create device bitmap failed
Alon Levy
alevy at redhat.com
Thu Dec 9 00:13:53 PST 2010
On Thu, Dec 09, 2010 at 09:07:23AM +0800, Coolper Chen wrote:
> DrvCreateDeviceBitmap will call FreeSurface function when
> CreateDeviceBitmap failed, no need call FreeSurface function in
> CreateDeviceBitmap function;
> It fixes the windows XP bluescreen problem that I encounter.
>
> diff --git a/display/surface.c b/display/surface.c
> index 7146b32..38200aa 100644
> --- a/display/surface.c
> +++ b/display/surface.c
> @@ -152,7 +152,6 @@ HBITMAP CreateDeviceBitmap(PDev *pdev, SIZEL size,
> ULONG format, QXLPHYSICAL *ph
> out_error3:
> QXLDelSurface(pdev, *base_mem, allocation_type);
> out_error2:
> - FreeSurface(pdev, surface_id);
> EngDeleteSurface((HSURF)surf);
> out_error1:
> return 0;
>
I'm not sure which version of the driver you are looking at, but I have:
line 104:
if (!(surf = EngCreateDeviceBitmap((DHSURF)GetSurfaceInfo(pdev, surface_id), size, format))) {
DEBUG_PRINT((NULL, 0, "%s: create device surface failed, 0x%lx\n",
__FUNCTION__, pdev));
goto out_error1;
}
And out_error1 is after the FreeSurface, as you can see from the piece you quoted.
> /Coolper Chen
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
More information about the Spice-devel
mailing list