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:
parent
db4735b7db
commit
eee15fff40
@ -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--;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user