libubus: Check if remove callback exists before call it
When process unsubscribes then remove callback is called. But it can be NULL if not defined, so we should check it before we call it. Signed-off-by: Lukasz Baj <l.baj@radytek.com>
This commit is contained in:
parent
b20a8a01c7
commit
d486006ab9
1 changed files with 2 additions and 1 deletions
|
@ -27,7 +27,8 @@ ubus_process_unsubscribe(struct ubus_context *ctx, struct ubus_msghdr *hdr,
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue