Mesa (9.0): intel: Don' t call intelDestroyContext if there is no context to destroy

Ian Romanick idr at kemper.freedesktop.org
Fri Sep 28 23:05:36 UTC 2012


Module: Mesa
Branch: 9.0
Commit: a87b0110b93597c6df5d84e720f685816d01ed40
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a87b0110b93597c6df5d84e720f685816d01ed40

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Fri Sep 28 08:29:12 2012 -0700

intel: Don't call intelDestroyContext if there is no context to destroy

Some error paths in the device-specific context creation functions can exit
before the deintel_context structure is allocated.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
(cherry picked from commit 22897c74979aa02facdd5cd729db8dadf86924f5)

---

 src/mesa/drivers/dri/intel/intel_screen.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 6b12097..f96583c 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -820,7 +820,9 @@ intelCreateContext(gl_api api,
    if (success)
       return true;
 
-   intelDestroyContext(driContextPriv);
+   if (driContextPriv->driverPrivate != NULL)
+      intelDestroyContext(driContextPriv);
+
    return false;
 }
 




More information about the mesa-commit mailing list