diff --git a/libweston/backend-drm/modes.c b/libweston/backend-drm/modes.c index 7c45e50a..e12ed625 100644 --- a/libweston/backend-drm/modes.c +++ b/libweston/backend-drm/modes.c @@ -685,7 +685,7 @@ static int drm_output_try_add_mode(struct drm_output *output, const drmModeModeInfo *info) { struct weston_mode *base; - struct drm_mode *mode; + struct drm_mode *mode = NULL; struct drm_backend *backend; const drmModeModeInfo *chosen = NULL; @@ -699,6 +699,7 @@ drm_output_try_add_mode(struct drm_output *output, const drmModeModeInfo *info) } if (chosen == info) { + assert(mode); backend = to_drm_backend(output->base.compositor); drm_output_destroy_mode(backend, mode); chosen = NULL; diff --git a/libweston/backend-headless/headless.c b/libweston/backend-headless/headless.c index c98bdc24..e9d0ad8f 100644 --- a/libweston/backend-headless/headless.c +++ b/libweston/backend-headless/headless.c @@ -450,6 +450,9 @@ headless_backend_create(struct weston_compositor *compositor, case HEADLESS_NOOP: ret = noop_renderer_init(compositor); break; + default: + assert(0 && "invalid renderer type"); + ret = -1; } if (ret < 0)