make ubus_default_connection_lost static
[project/ubus.git] / ubusd_obj.c
index 15f43ad..d1e53f8 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++;
 
@@ -114,7 +115,7 @@ struct ubus_object *ubusd_create_object(struct ubus_client *cl, struct blob_attr
        struct ubus_object_type *type = NULL;
 
        if (attr[UBUS_ATTR_OBJTYPE])
-               type = ubus_get_obj_type(blob_get_int32(attr[UBUS_ATTR_OBJTYPE]));
+               type = ubus_get_obj_type(blob_get_u32(attr[UBUS_ATTR_OBJTYPE]));
        else if (attr[UBUS_ATTR_SIGNATURE])
                type = ubus_create_obj_type(attr[UBUS_ATTR_SIGNATURE]);
 
@@ -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;