compositor-drm: Check that that we have a valid bo for scanout

If gbm_bo_import does not return a valid buffer for usage of
GBM_BO_USE_SCANOUT don't try and scan out the surface directly.

We've caught the SHM case explicitly earlier - this is to prevent other cases
where the bo cannot be scanned out.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 0faf45c..e41254b 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -292,6 +292,10 @@
 	bo = gbm_bo_import(c->gbm, GBM_BO_IMPORT_WL_BUFFER,
 			   es->buffer, GBM_BO_USE_SCANOUT);
 
+	/* Unable to use the buffer for scanout */
+	if (!bo)
+		return NULL;
+
 	/* Need to verify output->region contained in surface opaque
 	 * region.  Or maybe just that format doesn't have alpha.
 	 * For now, scanout only if format is XRGB8888. */