[PATCH weston v3 27/36] libweston: assert make/model in weston_output_enable()

Pekka Paalanen ppaalanen at gmail.com
Tue Oct 31 11:48:37 UTC 2017


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Output make and model are not allowed to be NULL in the protocol, so
ensure they are not forgotten when enabling an output.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
 libweston/compositor.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libweston/compositor.c b/libweston/compositor.c
index 3a2930e2..a85ff58f 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -5442,6 +5442,7 @@ weston_output_enable(struct weston_output *output)
 {
 	struct weston_compositor *c = output->compositor;
 	struct weston_output *iterator;
+	struct weston_head *head;
 	int x = 0, y = 0;
 
 	if (output->enabled) {
@@ -5456,6 +5457,11 @@ weston_output_enable(struct weston_output *output)
 		return -1;
 	}
 
+	wl_list_for_each(head, &output->head_list, output_link) {
+		assert(head->make);
+		assert(head->model);
+	}
+
 	iterator = container_of(c->output_list.prev,
 				struct weston_output, link);
 
-- 
2.13.6



More information about the wayland-devel mailing list