]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
mptcp: move subflow close loop after sk close check
authorFlorian Westphal <fw@strlen.de>
Fri, 12 Feb 2021 23:59:57 +0000 (15:59 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Feb 2021 00:31:45 +0000 (16:31 -0800)
In case mptcp socket is already dead the entire mptcp socket
will be freed. We can avoid the close check in this case.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/protocol.c

index 267c5521692d7a03644dd6b82b0af0e8524263d4..1b8be2bf6b43cf09f989a26488481e73dc16a4e4 100644 (file)
@@ -2246,9 +2246,6 @@ static void mptcp_worker(struct work_struct *work)
 
        mptcp_check_fastclose(msk);
 
-       if (test_and_clear_bit(MPTCP_WORK_CLOSE_SUBFLOW, &msk->flags))
-               __mptcp_close_subflow(msk);
-
        if (msk->pm.status)
                mptcp_pm_nl_work(msk);
 
@@ -2270,6 +2267,9 @@ static void mptcp_worker(struct work_struct *work)
                goto unlock;
        }
 
+       if (test_and_clear_bit(MPTCP_WORK_CLOSE_SUBFLOW, &msk->flags))
+               __mptcp_close_subflow(msk);
+
        if (!test_and_clear_bit(MPTCP_WORK_RTX, &msk->flags))
                goto unlock;