diff options
authorChris Wilson <>2011-08-25 12:45:43 +0100
committerChris Wilson <>2011-08-25 14:50:33 +0100
commit98b67457caea583de50bff1b11a3c5a2bd694e26 (patch)
parentb9ae4e7e71527f1cf2b6dd6890420da22a22fad9 (diff)
sna/display: Destroy shadow data
Under certain circumstances the shadow can be destroy after being allocated but before being created. The pixmap is a NULL pointer at that time, but we know that its value should be data, so just use the data pointer instead. Signed-off-by: Chris Wilson <>
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 0809eba1..5aee1047 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -764,6 +764,11 @@ sna_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr pixmap, void *data)
struct sna *sna = to_sna(crtc->scrn);
struct sna_crtc *sna_crtc = crtc->driver_private;
+ /* We may have not called shadow_create() on the data yet and
+ * be cleaning up a NULL shadow_pixmap.
+ */
+ pixmap = data;
DBG(("%s(fb=%d, handle=%d)\n", __FUNCTION__,
sna_crtc->shadow_fb_id, sna_pixmap_get_bo(pixmap)->handle));