1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

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:30:52 +09:00
parent db4735b7db
commit eee15fff40

View File

@ -160,8 +160,8 @@ int socket_broadcast_group_unref(sd_netlink *nl, unsigned group) {
assert(nl); assert(nl);
n_ref = broadcast_group_get_ref(nl, group); n_ref = broadcast_group_get_ref(nl, group);
if (n_ref == 0)
assert(n_ref > 0); return 0;
n_ref--; n_ref--;