[patch] xf86-video-intel: fix bo_list corruption

Lukas Hejtmanek xhejtman at ics.muni.cz
Mon Feb 4 02:05:46 PST 2008


Hello,

On Mon, Feb 04, 2008 at 05:00:49PM +0800, Hong Liu wrote:
> bo_list is corrupted when we call i830_free_3d_memory. 
> This happens when the virtual size is > 2048 for non-965 machine and
> it causes X server segfault because the front buffer is not binded when
> entering VT.

thanks, this also fixes this bug: 
https://bugs.freedesktop.org/show_bug.cgi?id=13685

Jesse, will you close the bug with some ptr to patch?


> diff --git a/src/i830_memory.c b/src/i830_memory.c
> index 5dbafee..31c8ad0 100644
> --- a/src/i830_memory.c
> +++ b/src/i830_memory.c
> @@ -274,12 +274,16 @@ i830_free_memory(ScrnInfoPtr pScrn, i830_memory *mem)
>  	I830Ptr pI830 = I830PTR(pScrn);
>  
>  	drmBOUnreference(pI830->drmSubFD, &mem->bo);
> -	if (pI830->bo_list == mem)
> +	if (pI830->bo_list == mem) {
>  	    pI830->bo_list = mem->next;
> -	if (mem->next)
> -	    mem->next->prev = NULL;
> -	if (mem->prev)
> -	    mem->prev->next = NULL;
> +	    if (mem->next)
> +		mem->next->prev = NULL;
> +	} else {
> +	    if (mem->prev)
> +		mem->prev->next = mem->next;
> +	    if (mem->next)
> +		mem->next->prev = mem->prev;
> +	}
>  	xfree(mem->name);
>  	xfree(mem);
>  	return;
> 

-- 
Lukáš Hejtmánek



More information about the xorg mailing list