sd-netlink: do not trigger assertion by calling socket_broadcast_group_unref() with an arbitrary group number

socket_broadcast_group_unref() is only called in netlink_slot_disconnect(),
so the assertion should not be triggered as the match slot was
successfully created.

But, we usually design `_ref/unref()` functions as they can be called
for any inputs. So, let's also follow the design rule here.
This commit is contained in:
Yu Watanabe
2021-06-27 02:47:34 +09:00
parent db4735b7db
commit eee15fff40
+2 -2
View File
@@ -160,8 +160,8 @@ int socket_broadcast_group_unref(sd_netlink *nl, unsigned group) {
assert(nl);
n_ref = broadcast_group_get_ref(nl, group);
assert(n_ref > 0);
if (n_ref == 0)
return 0;
n_ref--;