libubus: check if subscriber cb is non-NULL before calling it
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
ee9e399096
commit
e9431842e2
1 changed files with 2 additions and 1 deletions
|
@ -21,6 +21,7 @@ static int ubus_subscriber_cb(struct ubus_context *ctx, struct ubus_object *obj,
|
||||||
struct ubus_subscriber *s;
|
struct ubus_subscriber *s;
|
||||||
|
|
||||||
s = container_of(obj, struct ubus_subscriber, obj);
|
s = container_of(obj, struct ubus_subscriber, obj);
|
||||||
|
if (s->cb)
|
||||||
s->cb(ctx, obj, req, method, msg);
|
s->cb(ctx, obj, req, method, msg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue