Bug 20260 - some fault in xf86FBManagerLinear memory management
some fault in xf86FBManagerLinear memory management
Status: NEW
Product: xorg
Classification: Unclassified
Component: Server/DDX/Xorg
7.4 (2008.09)
x86 (IA32) Linux (All)
: medium normal
Assigned To: Xorg Project Team
Xorg Project Team
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-22 18:55 UTC by Bo Du
Modified: 2009-02-26 21:57 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bo Du 2009-02-22 18:55:02 UTC
There is some fault in the memory management algorithm of xf86FBManagerLinear.
It perform combine backwards without checking pLinkPrev->free, it will cause video memory lost in some situation.

Line 1030 in xorg-server-1.5.2\hw\xfree86\common\xf86fbman.c
   static void localFreeOffscreenLinear(FBLinearPtr linear)

1020   pLink->free = 1;

1029   if(pLinkPrev) {
1030   	if (pLinkPrev->next && pLinkPrev->next->free && !pLinkPrev->area) {
1031      	    FBLinearLinkPtr p = pLinkPrev->next;
1032      	    pLinkPrev->linear.size += p->linear.size;
1033      	    pLinkPrev->next = p->next;
1034      	    free(p);
1035    	}
1036   } 


The fault:
missing check whether pLinkPrev->free ??? but check pLinkPrev->next->free wrongly ? In fact, no need to check pLinkPrev->next->free, because it is set as 1 already in Line 1020.