Bug 15401

Summary: [patch] derf before NULL check patch, -unused var
Product: xorg Reporter: Roland "Test-tools" Bär <roland>
Component: Driver/intelAssignee: Eric Anholt <eric>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium Keywords: janitor, patch
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
fixes this none

Description Roland "Test-tools" Bär 2008-04-08 00:58:26 UTC
Created attachment 15751 [details] [review]
fixes this

Hello,

attached patch fixes two dereference before NULL check problems and
removes a effectivly unused variable (which was bad free'd).

Roland
Comment 1 Gordon Jin 2008-04-08 04:28:13 UTC
Thanks for the patch. Let Zhenyu to commit.
Comment 2 Gordon Jin 2008-04-15 18:06:14 UTC
Below block is not 100% correct. bufmgr_ttm should also be initialized later.


@@ -619,12 +621,14 @@ dri_ttm_fence_reference(dri_fence *fence)
 static void
 dri_ttm_fence_unreference(dri_fence *fence)
 {
-    dri_fence_ttm *fence_ttm = (dri_fence_ttm *)fence;
+    dri_fence_ttm *fence_ttm;
     dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)fence->bufmgr;
 
     if (!fence)
 	return;
 
+    fence_ttm = (dri_fence_ttm *)fence;
+
     DBG("fence_unreference: %p (%s)\n", &fence_ttm->fence, fence_ttm->name);
Comment 3 Gordon Jin 2008-06-28 21:42:49 UTC
Eric, can we close this bug now?
Comment 4 Eric Anholt 2008-06-30 10:36:16 UTC
Fix committed for i810 xvmc part.  The other part appears to be for the intel-batchbuffer branch, which is a dead end at this point (we're redoing it on GEM)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.