Skip to content

Commit

Permalink
Merge branch 'mptcp-miscellaneous-cleanup'
Browse files Browse the repository at this point in the history
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 f8c9dfb ("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.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Dec 10, 2022
2 parents c80edd8 + 03e7d28 commit 2b53d86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions net/mptcp/pm_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ static int mptcp_pm_parse_pm_addr_attr(struct nlattr *tb[],

if (!tb[MPTCP_PM_ADDR_ATTR_FAMILY]) {
if (!require_family)
return err;
return 0;

NL_SET_ERR_MSG_ATTR(info->extack, attr,
"missing family");
Expand Down Expand Up @@ -1224,7 +1224,7 @@ static int mptcp_pm_parse_pm_addr_attr(struct nlattr *tb[],
if (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,
Expand Down 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
2 changes: 1 addition & 1 deletion net/mptcp/sockopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ static int mptcp_setsockopt_v4_set_tos(struct mptcp_sock *msk, int optname,
}
release_sock(sk);

return err;
return 0;
}

static int mptcp_setsockopt_v4(struct mptcp_sock *msk, int optname,
Expand Down

0 comments on commit 2b53d86

Please sign in to comment.