Commit dfd51be3 authored by Olivier Fourdan's avatar Olivier Fourdan Committed by Adam Jackson

xwayland: Do not free a NULL GBM bo

Both `gbm_bo_create()` and `gbm_bo_create_with_modifiers()` can fail and
return `NULL`.

If that occurs, `xwl_glamor_gbm_create_pixmap()` will not create a
pixmap for the (NULL) GBM bo, but would still try to free the bo which
leads to a crash in mesa:

  #7  <signal handler called>
  #8  in gbm_bo_destroy (bo=0x0) at ../src/gbm/main/gbm.c:439
  #9  in xwl_glamor_gbm_create_pixmap () at xwayland-glamor-gbm.c:245
  #10 in ProcCreatePixmap () at dispatch.c:1440
  #11 in Dispatch () at dispatch.c:478
  #12 in dix_main () at main.c:276

To avoid the crash, only free the GBM bo if not `NULL`.
Signed-off-by: default avatarOlivier Fourdan <>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <>
(cherry picked from commit d9ec5250)
parent df7ee10d
Pipeline #51617 passed with stages
in 7 minutes and 7 seconds
......@@ -238,11 +238,12 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen,
if (bo)
if (bo) {
pixmap = xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth);
if (!pixmap)
if (!pixmap)
if (!pixmap)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment