return;
s = container_of(obj, struct ubus_subscriber, obj);
- s->remove_cb(ctx, s, blob_get_u32(attrbuf[UBUS_ATTR_TARGET]));
+ if (s->remove_cb)
+ s->remove_cb(ctx, s, blob_get_u32(attrbuf[UBUS_ATTR_TARGET]));
}
static void
ubus_process_invoke(struct ubus_context *ctx, struct ubus_msghdr *hdr,
struct ubus_object *obj, struct blob_attr **attrbuf)
{
- struct ubus_request_data req = {};
+ struct ubus_request_data req = {
+ .fd = -1,
+ };
int method;
int ret;
bool no_reply = false;
struct ubus_object *obj;
uint32_t objid;
- attrbuf = ubus_parse_msg(hdr->data);
+ attrbuf = ubus_parse_msg(ubus_msghdr_data(hdr));
if (!attrbuf[UBUS_ATTR_OBJID])
return;