Mesa (9.0): i915: Don' t free the intel_context structure when intelCreateContext fails.

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


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

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Sep 26 17:57:01 2012 -0700

i915: Don't free the intel_context structure when intelCreateContext fails.

intelDestroyContext will eventually be called, and it will clean things up.

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
(cherry picked from commit de958de71b1450952e021af4e729c87406353db6)

---

 src/mesa/drivers/dri/i915/i915_context.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c
index 1a0baa2..c0d1f93 100644
--- a/src/mesa/drivers/dri/i915/i915_context.c
+++ b/src/mesa/drivers/dri/i915/i915_context.c
@@ -167,7 +167,6 @@ i915CreateContext(int api,
 
    if (!intelInitContext(intel, api, mesaVis, driContextPriv,
                          sharedContextPrivate, &functions)) {
-      FREE(i915);
       *error = __DRI_CTX_ERROR_NO_MEMORY;
       return false;
    }
@@ -184,7 +183,6 @@ i915CreateContext(int api,
 
       if (req_version > max_version) {
          *error = __DRI_CTX_ERROR_BAD_VERSION;
-         FREE(i915);
          return false;
       }
       break;
@@ -194,7 +192,6 @@ i915CreateContext(int api,
       break;
    default:
       *error = __DRI_CTX_ERROR_BAD_API;
-      FREE(i915);
       return false;
    }
 




More information about the mesa-commit mailing list