Skip to content

Commit

Permalink
mptcp: use nlmsg_free instead of kfree_skb
Browse files Browse the repository at this point in the history
Use nlmsg_free() instead of kfree_skb() in pm_netlink.c.

The SKB's have been created by nlmsg_new(). The proper cleaning way
should then be done with nlmsg_free().

For the moment, nlmsg_free() is simply calling kfree_skb() so we don't
change the behaviour here.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Geliang Tang authored and Jakub Kicinski committed Dec 10, 2022
1 parent c80edd8 commit 8b34b52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/mptcp/pm_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,7 @@ void mptcp_event_addr_removed(const struct mptcp_sock *msk, uint8_t id)
return;

nla_put_failure:
kfree_skb(skb);
nlmsg_free(skb);
}

void mptcp_event_addr_announced(const struct sock *ssk,
Expand Down Expand Up @@ -2151,7 +2151,7 @@ void mptcp_event_addr_announced(const struct sock *ssk,
return;

nla_put_failure:
kfree_skb(skb);
nlmsg_free(skb);
}

void mptcp_event_pm_listener(const struct sock *ssk,
Expand Down Expand Up @@ -2203,7 +2203,7 @@ void mptcp_event_pm_listener(const struct sock *ssk,
return;

nla_put_failure:
kfree_skb(skb);
nlmsg_free(skb);
}

void mptcp_event(enum mptcp_event_type type, const struct mptcp_sock *msk,
Expand Down Expand Up @@ -2261,7 +2261,7 @@ void mptcp_event(enum mptcp_event_type type, const struct mptcp_sock *msk,
return;

nla_put_failure:
kfree_skb(skb);
nlmsg_free(skb);
}

static const struct genl_small_ops mptcp_pm_ops[] = {
Expand Down

0 comments on commit 8b34b52

Please sign in to comment.