summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-07-15 14:26:03 +0200
committerThomas Haller <thaller@redhat.com>2018-09-07 11:24:17 +0200
commita30dd1eff041751fd26d5e3dba1a5f5693569ba5 (patch)
tree3728cf4045c8571ad7d107780a29331b2c6b90b2
parente9cf8b196deebdfcb4263bb6a6606f72d9cd0b6f (diff)
downloadNetworkManager-a30dd1eff041751fd26d5e3dba1a5f5693569ba5.tar.gz
platform/netlink: drop ref-counting for "struct nl_msg"
It was unused.
-rw-r--r--src/platform/nm-netlink.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/platform/nm-netlink.c b/src/platform/nm-netlink.c
index cec3ba8fe9..7b79a772c0 100644
--- a/src/platform/nm-netlink.c
+++ b/src/platform/nm-netlink.c
@@ -52,7 +52,6 @@ struct nl_msg {
struct ucred nm_creds;
struct nlmsghdr * nm_nlh;
size_t nm_size;
- int nm_refcnt;
};
struct nl_sock {
@@ -310,7 +309,6 @@ nlmsg_alloc_size (size_t len)
nm = g_slice_new0 (struct nl_msg);
- nm->nm_refcnt = 1;
nm->nm_protocol = -1;
nm->nm_size = len;
nm->nm_nlh = g_malloc0 (len);
@@ -361,15 +359,8 @@ void nlmsg_free (struct nl_msg *msg)
if (!msg)
return;
- if (msg->nm_refcnt < 1)
- g_return_if_reached ();
-
- msg->nm_refcnt--;
-
- if (msg->nm_refcnt <= 0) {
- g_free (msg->nm_nlh);
- g_slice_free (struct nl_msg, msg);
- }
+ g_free (msg->nm_nlh);
+ g_slice_free (struct nl_msg, msg);
}
/*****************************************************************************/