Commit 2b53d869 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'mptcp-miscellaneous-cleanup'

Mat Martineau says:

====================
mptcp: Miscellaneous cleanup

Two code cleanup patches for the 6.2 merge window that don't change
behavior:

Patch 1 makes proper use of nlmsg_free(), as suggested by Jakub while
reviewing f8c9dfbd ("mptcp: add pm listener events").

Patch 2 clarifies success status in a few mptcp functions, which
prevents some smatch false positives.
====================

Link: https://lore.kernel.org/r/20221209004431.143701-1-mathew.j.martineau@linux.intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents c80edd8d 03e7d28c
...@@ -1190,7 +1190,7 @@ static int mptcp_pm_parse_pm_addr_attr(struct nlattr *tb[], ...@@ -1190,7 +1190,7 @@ static int mptcp_pm_parse_pm_addr_attr(struct nlattr *tb[],
if (!tb[MPTCP_PM_ADDR_ATTR_FAMILY]) { if (!tb[MPTCP_PM_ADDR_ATTR_FAMILY]) {
if (!require_family) if (!require_family)
return err; return 0;
NL_SET_ERR_MSG_ATTR(info->extack, attr, NL_SET_ERR_MSG_ATTR(info->extack, attr,
"missing family"); "missing family");
...@@ -1224,7 +1224,7 @@ static int mptcp_pm_parse_pm_addr_attr(struct nlattr *tb[], ...@@ -1224,7 +1224,7 @@ static int mptcp_pm_parse_pm_addr_attr(struct nlattr *tb[],
if (tb[MPTCP_PM_ADDR_ATTR_PORT]) if (tb[MPTCP_PM_ADDR_ATTR_PORT])
addr->port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT])); addr->port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT]));
return err; return 0;
} }
int mptcp_pm_parse_addr(struct nlattr *attr, struct genl_info *info, int mptcp_pm_parse_addr(struct nlattr *attr, struct genl_info *info,
...@@ -2094,7 +2094,7 @@ void mptcp_event_addr_removed(const struct mptcp_sock *msk, uint8_t id) ...@@ -2094,7 +2094,7 @@ void mptcp_event_addr_removed(const struct mptcp_sock *msk, uint8_t id)
return; return;
nla_put_failure: nla_put_failure:
kfree_skb(skb); nlmsg_free(skb);
} }
void mptcp_event_addr_announced(const struct sock *ssk, void mptcp_event_addr_announced(const struct sock *ssk,
...@@ -2151,7 +2151,7 @@ void mptcp_event_addr_announced(const struct sock *ssk, ...@@ -2151,7 +2151,7 @@ void mptcp_event_addr_announced(const struct sock *ssk,
return; return;
nla_put_failure: nla_put_failure:
kfree_skb(skb); nlmsg_free(skb);
} }
void mptcp_event_pm_listener(const struct sock *ssk, void mptcp_event_pm_listener(const struct sock *ssk,
...@@ -2203,7 +2203,7 @@ void mptcp_event_pm_listener(const struct sock *ssk, ...@@ -2203,7 +2203,7 @@ void mptcp_event_pm_listener(const struct sock *ssk,
return; return;
nla_put_failure: nla_put_failure:
kfree_skb(skb); nlmsg_free(skb);
} }
void mptcp_event(enum mptcp_event_type type, const struct mptcp_sock *msk, void mptcp_event(enum mptcp_event_type type, const struct mptcp_sock *msk,
...@@ -2261,7 +2261,7 @@ void mptcp_event(enum mptcp_event_type type, const struct mptcp_sock *msk, ...@@ -2261,7 +2261,7 @@ void mptcp_event(enum mptcp_event_type type, const struct mptcp_sock *msk,
return; return;
nla_put_failure: nla_put_failure:
kfree_skb(skb); nlmsg_free(skb);
} }
static const struct genl_small_ops mptcp_pm_ops[] = { static const struct genl_small_ops mptcp_pm_ops[] = {
......
...@@ -740,7 +740,7 @@ static int mptcp_setsockopt_v4_set_tos(struct mptcp_sock *msk, int optname, ...@@ -740,7 +740,7 @@ static int mptcp_setsockopt_v4_set_tos(struct mptcp_sock *msk, int optname,
} }
release_sock(sk); release_sock(sk);
return err; return 0;
} }
static int mptcp_setsockopt_v4(struct mptcp_sock *msk, int optname, static int mptcp_setsockopt_v4(struct mptcp_sock *msk, int optname,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment