void ubusd_event_cleanup_object(struct ubus_object *obj)
{
- struct event_source *ev;
+ struct event_source *ev, *tmp;
- while (!list_empty(&obj->events)) {
- ev = list_first_entry(&obj->events, struct event_source, list);
+ list_for_each_entry_safe(ev, tmp, &obj->events, list) {
ubusd_delete_event_source(ev);
}
}
bool partial = false;
int len;
+ if (!msg)
+ return UBUS_STATUS_INVALID_ARGUMENT;
+
blobmsg_parse(evr_policy, EVREG_LAST, attr, blob_data(msg), blob_len(msg));
if (!attr[EVREG_OBJECT] || !attr[EVREG_PATTERN])
return UBUS_STATUS_INVALID_ARGUMENT;
struct blob_attr *attr[EVMSG_LAST];
const char *id;
+ if (!msg)
+ return UBUS_STATUS_INVALID_ARGUMENT;
+
blobmsg_parse(ev_policy, EVMSG_LAST, attr, blob_data(msg), blob_len(msg));
if (!attr[EVMSG_ID] || !attr[EVMSG_DATA])
return UBUS_STATUS_INVALID_ARGUMENT;