MPTCP Linux Development
 help / color / mirror / Atom feed
* [PATCH mptcp-next] Squash to "mptcp: pm: add id parameter for get_addr"
@ 2025-01-17 23:26 Geliang Tang
  2025-01-18  7:50 ` Matthieu Baerts
  0 siblings, 1 reply; 6+ messages in thread
From: Geliang Tang @ 2025-01-17 23:26 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

No need to drop 'attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];' in
mptcp_userspace_pm_get_addr() too, add it back.

Alse update mptcp_pm_nl_get_addr() to keep the original two-line
assignment of 'attr'.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 net/mptcp/pm_netlink.c   | 4 +++-
 net/mptcp/pm_userspace.c | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index f7da750ab94f..b3d32f43a5a1 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1775,13 +1775,15 @@ int mptcp_nl_fill_addr(struct sk_buff *skb,
 
 int mptcp_pm_nl_get_addr(u8 id, struct genl_info *info)
 {
-	struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
 	struct pm_nl_pernet *pernet = genl_info_pm_nl(info);
 	struct mptcp_pm_addr_entry *entry;
 	struct sk_buff *msg;
+	struct nlattr *attr;
 	void *reply;
 	int ret;
 
+	attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
+
 	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
 	if (!msg)
 		return -ENOMEM;
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 79e2d12e0888..e005d5302e1c 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -700,6 +700,8 @@ int mptcp_userspace_pm_get_addr(u8 id, struct genl_info *info)
 
 	sk = (struct sock *)msk;
 
+	attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
+
 	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
 	if (!msg) {
 		ret = -ENOMEM;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-01-20  9:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17 23:26 [PATCH mptcp-next] Squash to "mptcp: pm: add id parameter for get_addr" Geliang Tang
2025-01-18  7:50 ` Matthieu Baerts
2025-01-18 10:54   ` Geliang Tang
2025-01-20  8:20     ` Matthieu Baerts
2025-01-20  9:55       ` Geliang Tang
2025-01-18 10:56   ` Geliang Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox