The fix in
4821263c4 checks for a negative socket. While the
commit message explains the reason for the check, it is not
obvious why this check is needed when looking at the code
itself.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
ust_registry_channel_del_free(registry, ua_chan->key,
sock >= 0);
}
+ /*
+ * A negative socket can be used by the caller when
+ * cleaning-up a ua_chan in an error path. Skip the
+ * accounting in this case.
+ */
if (sock >= 0) {
save_per_pid_lost_discarded_counters(ua_chan);
}