platform/netlink: drop ref-counting for "struct nl_msg"
It was unused.
This commit is contained in:
@@ -52,7 +52,6 @@ struct nl_msg {
|
|||||||
struct ucred nm_creds;
|
struct ucred nm_creds;
|
||||||
struct nlmsghdr * nm_nlh;
|
struct nlmsghdr * nm_nlh;
|
||||||
size_t nm_size;
|
size_t nm_size;
|
||||||
int nm_refcnt;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct nl_sock {
|
struct nl_sock {
|
||||||
@@ -310,7 +309,6 @@ nlmsg_alloc_size (size_t len)
|
|||||||
|
|
||||||
nm = g_slice_new0 (struct nl_msg);
|
nm = g_slice_new0 (struct nl_msg);
|
||||||
|
|
||||||
nm->nm_refcnt = 1;
|
|
||||||
nm->nm_protocol = -1;
|
nm->nm_protocol = -1;
|
||||||
nm->nm_size = len;
|
nm->nm_size = len;
|
||||||
nm->nm_nlh = g_malloc0 (len);
|
nm->nm_nlh = g_malloc0 (len);
|
||||||
@@ -361,15 +359,8 @@ void nlmsg_free (struct nl_msg *msg)
|
|||||||
if (!msg)
|
if (!msg)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (msg->nm_refcnt < 1)
|
g_free (msg->nm_nlh);
|
||||||
g_return_if_reached ();
|
g_slice_free (struct nl_msg, msg);
|
||||||
|
|
||||||
msg->nm_refcnt--;
|
|
||||||
|
|
||||||
if (msg->nm_refcnt <= 0) {
|
|
||||||
g_free (msg->nm_nlh);
|
|
||||||
g_slice_free (struct nl_msg, msg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
Reference in New Issue
Block a user