Bug 15401 - [patch] derf before NULL check patch, -unused var
Summary: [patch] derf before NULL check patch, -unused var
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Eric Anholt
QA Contact: Xorg Project Team
Keywords: janitor, patch
Depends on:
Reported: 2008-04-08 00:58 UTC by Roland "Test-tools" Bär
Modified: 2008-06-30 10:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

fixes this (2.67 KB, patch)
2008-04-08 00:58 UTC, Roland "Test-tools" Bär
no flags Details | Splinter Review

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


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

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)
+    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.