Would try to destroy radeon->cman, radeon->kman both which were still
NULL.
---
 src/gallium/winsys/r600/drm/r600_drm.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/gallium/winsys/r600/drm/r600_drm.c 
b/src/gallium/winsys/r600/drm/r600_drm.c
index 5f175a4..4916843 100644
--- a/src/gallium/winsys/r600/drm/r600_drm.c
+++ b/src/gallium/winsys/r600/drm/r600_drm.c
@@ -179,9 +179,15 @@ struct radeon *radeon_decref(struct radeon *radeon)
                return NULL;
        }
 
-       radeon->cman->destroy(radeon->cman);
-       radeon->kman->destroy(radeon->kman);
-       drmClose(radeon->fd);
+        if (radeon->cman)
+           radeon->cman->destroy(radeon->cman);
+
+        if (radeon->kman)
+           radeon->kman->destroy(radeon->kman);
+
+        if (radeon->fd >= 0)
+           drmClose(radeon->fd);
+
        free(radeon);
        return NULL;
 }
-- 
1.7.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to