[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#590462: xserver-xorg-video-radeon: two more gdb stack traces



On Fre, 2010-08-06 at 11:19 +0200, Michal Suchanek wrote: 
> 
> The issue is quite reliably reproducible, sending two more backtraces.
> 
> They are not identical but to me look similar.

Does the attached patch for xserver-xorg-video-radeon fix these crashes?
Though even if it does, it feels like just a band-aid for the real root
cause...


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index a0ed085..ae8951f 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -153,20 +153,9 @@ radeon_dri2_create_buffer(DrawablePtr drawable,
     struct dri2_buffer_priv *privates;
     PixmapPtr pixmap, depth_pixmap;
     struct radeon_exa_pixmap_priv *driver_priv;
-    int r;
     int flags;
 
-    buffers = calloc(1, sizeof *buffers);
-    if (buffers == NULL) {
-        return NULL;
-    }
-    privates = calloc(1, sizeof(struct dri2_buffer_priv));
-    if (privates == NULL) {
-        free(buffers);
-        return NULL;
-    }
-
-    depth_pixmap = NULL;
+    pixmap = depth_pixmap = NULL;
 
     if (attachment == DRI2BufferFrontLeft) {
         if (drawable->type == DRAWABLE_PIXMAP) {
@@ -201,6 +190,15 @@ radeon_dri2_create_buffer(DrawablePtr drawable,
                 flags);
     }
 
+    if (!pixmap) {
+        return NULL;
+    }
+
+    buffers = calloc(1, sizeof *buffers);
+    if (buffers == NULL) {
+        return NULL;
+    }
+
     if (attachment == DRI2BufferDepth) {
         depth_pixmap = pixmap;
     }
@@ -208,9 +206,17 @@ radeon_dri2_create_buffer(DrawablePtr drawable,
     exaMoveInPixmap(pixmap);
     info->exa_force_create = FALSE;
     driver_priv = exaGetPixmapDriverPrivate(pixmap);
-    r = radeon_gem_get_kernel_name(driver_priv->bo, &buffers->name);
-    if (r)
-	    return NULL;
+    if (!driver_priv ||
+	(radeon_gem_get_kernel_name(driver_priv->bo, &buffers->name) != 0)) {
+        free(buffers);
+        return NULL;
+    }
+
+    privates = calloc(1, sizeof(struct dri2_buffer_priv));
+    if (privates == NULL) {
+        free(buffers);
+        return NULL;
+    }
 
     buffers->attachment = attachment;
     buffers->pitch = pixmap->devKind;

Reply to: