From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4C3C4FB9A6; Wed, 30 Sep 2026 17:43:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790790240; cv=none; b=cEfDrjx7NrFbNumSTx3p8x6Ks2DOXqD+kneZD9D5Oc60ExWKwbaX2GzIzqc3wCNenjojQBwFBI2JIJjqL4L/8u9BR3bthC9y0fMmrWVdQ98cK7gFuZHNv5v5Pk8ECOWMfi2+mrRxB7LT3hKCmaRu+sF71PxdcArvzAFRjH7moG8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790790240; c=relaxed/simple; bh=OcnUwVrJL4qJj9QfXoa5GRQKcf5W4itMGlEwojejlBQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Tlg2azXKmppPNZHfdfgKDpiTPX3qyTV+5BIbpgrmBdZGGl57IMW+9auDU5P7W9Tc0FwzhuBEsxSg9wJy0pBN8rtBsmn3pRGmD8y+5dsfHHGkpyECQbJGVmnUUNHXKjw5f1+89JOz8cJHnhIbpHmtgG+4v6Glg25Ei8IP4oPOQ10= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TzZ6iR+P; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="TzZ6iR+P" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A0501F000FF; Wed, 30 Sep 2026 17:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790790238; bh=rtWaARWXvvrPAdu2ltN+aFq71WaYZf7E5ybp/Uu76K8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TzZ6iR+PRPt6w0UOnNNOHUbINjLbcrermo+nILcwPAIlii+A3WotykVdbYfqV5dcj mJDcTYS8VbZxXNdkihGA6JWKc29xPHGZkD65ZXhYf8Iqik6SiLCxuIuqU4LIhD/beE u/UkNp3+PE/Tz4Tpla/YbxLkDEtrVCn6Cl3FIfh4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Geliang Tang , "Matthieu Baerts (NGI0)" , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 759/877] mptcp: pm: drop match in userspace_pm_append_new_local_addr Date: Wed, 30 Sep 2026 17:27:50 +0200 Message-ID: <20260930152431.080034059@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152414.738996857@linuxfoundation.org> References: <20260930152414.738996857@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Geliang Tang [ Upstream commit 640e3d69d0bc70d7d3de34800a1640793262bd08 ] The variable 'match' in mptcp_userspace_pm_append_new_local_addr() is a redundant one, and this patch drops it. No need to define 'match' as 'struct mptcp_pm_addr_entry *' type. In this function, it's only used to check whether it's NULL. It can be defined as a Boolean one. Also other variables 'addr_match' and 'id_match' make 'match' a redundant one, which can be replaced by directly checking 'addr_match && id_match'. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20250221-net-next-mptcp-pm-misc-cleanup-3-v1-5-2b70ab1cee79@kernel.org Signed-off-by: Jakub Kicinski Stable-dep-of: f9f0068e8813 ("mptcp: pm: userspace: fix address ID overflow") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/mptcp/pm_userspace.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -41,7 +41,6 @@ static int mptcp_userspace_pm_append_new bool needs_id) { DECLARE_BITMAP(id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1); - struct mptcp_pm_addr_entry *match = NULL; struct sock *sk = (struct sock *)msk; struct mptcp_pm_addr_entry *e; bool addr_match = false; @@ -60,16 +59,12 @@ static int mptcp_userspace_pm_append_new if (addr_match && entry->addr.id == 0 && needs_id) entry->addr.id = e->addr.id; id_match = (e->addr.id == entry->addr.id); - if (addr_match && id_match) { - match = e; + if (addr_match || id_match) break; - } else if (addr_match || id_match) { - break; - } __set_bit(e->addr.id, id_bitmap); } - if (!match && !addr_match && !id_match) { + if (!addr_match && !id_match) { /* Memory for the entry is allocated from the * sock option buffer. */ @@ -87,7 +82,7 @@ static int mptcp_userspace_pm_append_new list_add_tail_rcu(&e->list, &msk->pm.userspace_pm_local_addr_list); msk->pm.local_addr_used++; ret = e->addr.id; - } else if (match) { + } else if (addr_match && id_match) { ret = entry->addr.id; }