fix event handler list initialization
authorFelix Fietkau <nbd@openwrt.org>
Sun, 6 Feb 2011 00:53:58 +0000 (01:53 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 6 Feb 2011 00:53:58 +0000 (01:53 +0100)
ubusd_obj.c

index 15f43ad64e6e3c060843c61c8317bf933ed982a7..ffd5330560f529d0f4cf1881fa57c03b659309ad 100644 (file)
@@ -98,6 +98,7 @@ struct ubus_object *ubusd_create_object_internal(struct ubus_object_type *type,
 
        obj->type = type;
        INIT_LIST_HEAD(&obj->list);
+       INIT_LIST_HEAD(&obj->events);
        if (type)
                type->refcount++;
 
@@ -142,7 +143,6 @@ struct ubus_object *ubusd_create_object(struct ubus_client *cl, struct blob_attr
 
        obj->client = cl;
        list_add(&obj->list, &cl->objects);
-       INIT_LIST_HEAD(&obj->events);
 
        return obj;