mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 05:04:09 +08:00
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 f8c9dfbd87
("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>
This commit is contained in:
commit
2b53d8698a
@ -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");
|
||||
@ -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,
|
||||
@ -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,
|
||||
@ -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,
|
||||
@ -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,
|
||||
@ -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[] = {
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user