From: Dave Airlie <[email protected]>

With the missing RRProviderInit, we were adding 0 typed resources,
which crashed when xrestop hit them, we should warn before that happens
so future developers spot the problem.

Signed-off-by: Dave Airlie <[email protected]>
---
 dix/resource.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dix/resource.c b/dix/resource.c
index 2aafa34..144fe23 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -793,6 +793,7 @@ AddResource(XID id, RESTYPE type, pointer value)
     ClientResourceRec *rrec;
     ResourcePtr res, *head;
 
+    BUG_RETURN_VAL_MSG(type == 0, FALSE, "Illegal to allocate resources with 
type 0\n");
 #ifdef XSERVER_DTRACE
     XSERVER_RESOURCE_ALLOC(id, type, value, TypeNameString(type));
 #endif
-- 
1.7.11.7

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to