[PATCH mptcp-next] Squash to "mptcp: userspace pm remove id 0 address, v7"

Geliang Tang posted 1 patch 9 months, 1 week ago
Failed in applying to current master (apply log)
net/mptcp/pm_userspace.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
[PATCH mptcp-next] Squash to "mptcp: userspace pm remove id 0 address, v7"
Posted by Geliang Tang 9 months, 1 week ago
Define sk = (struct sock *)msk.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 net/mptcp/pm_userspace.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 41d2d57b570c..b0fd7440016d 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -213,10 +213,11 @@ static int mptcp_userspace_remove_id_zero_address(struct mptcp_sock *msk,
 {
 	struct mptcp_rm_list list = { .nr = 0 };
 	struct mptcp_subflow_context *subflow;
+	struct sock *sk = (struct sock *)msk;
 	bool has_id_0 = false;
 	int err = -EINVAL;
 
-	lock_sock((struct sock *)msk);
+	lock_sock(sk);
 	spin_lock_bh(&msk->pm.lock);
 	mptcp_for_each_subflow(msk, subflow) {
 		if (subflow->remote_id == 0) {
@@ -234,8 +235,8 @@ static int mptcp_userspace_remove_id_zero_address(struct mptcp_sock *msk,
 	err = 0;
 out:
 	spin_unlock_bh(&msk->pm.lock);
-	release_sock((struct sock *)msk);
-	sock_put((struct sock *)msk);
+	release_sock(sk);
+	sock_put(sk);
 	return err;
 }
 
-- 
2.35.3