From: Matt Johnston <matt@codeconstruct.com.au>
To: Jeremy Kerr <jk@codeconstruct.com.au>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, Matt Johnston <matt@codeconstruct.com.au>
Subject: [PATCH net-next v4 1/8] net: mctp: mctp_test_route_extaddr_input cleanup
Date: Thu, 10 Jul 2025 16:55:54 +0800 [thread overview]
Message-ID: <20250710-mctp-bind-v4-1-8ec2f6460c56@codeconstruct.com.au> (raw)
In-Reply-To: <20250710-mctp-bind-v4-0-8ec2f6460c56@codeconstruct.com.au>
The sock was not being released. Other than leaking, the stale socket
will conflict with subsequent bind() calls in unrelated MCTP tests.
Fixes: 46ee16462fed ("net: mctp: test: Add extaddr routing output test")
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
---
Added in v3. The problem was introduced in current net-next so
this patch isn't needed in the stable tree.
v4:
- Use correct Fixes: rev
---
net/mctp/test/route-test.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/mctp/test/route-test.c b/net/mctp/test/route-test.c
index 7a398f41b6216afef72adecf118199753ed1bfea..12811032a2696167b4f319cbc9c81fef4cb2d951 100644
--- a/net/mctp/test/route-test.c
+++ b/net/mctp/test/route-test.c
@@ -1164,8 +1164,6 @@ static void mctp_test_route_extaddr_input(struct kunit *test)
rc = mctp_dst_input(&dst, skb);
KUNIT_ASSERT_EQ(test, rc, 0);
- mctp_test_dst_release(&dst, &tpq);
-
skb2 = skb_recv_datagram(sock->sk, MSG_DONTWAIT, &rc);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, skb2);
KUNIT_ASSERT_EQ(test, skb2->len, len);
@@ -1179,8 +1177,8 @@ static void mctp_test_route_extaddr_input(struct kunit *test)
KUNIT_EXPECT_EQ(test, cb2->halen, sizeof(haddr));
KUNIT_EXPECT_MEMEQ(test, cb2->haddr, haddr, sizeof(haddr));
- skb_free_datagram(sock->sk, skb2);
- mctp_test_destroy_dev(dev);
+ kfree_skb(skb2);
+ __mctp_route_test_fini(test, dev, &dst, &tpq, sock);
}
static void mctp_test_route_gw_lookup(struct kunit *test)
--
2.43.0
next prev parent reply other threads:[~2025-07-10 8:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 8:55 [PATCH net-next v4 0/8] net: mctp: Improved bind handling Matt Johnston
2025-07-10 8:55 ` Matt Johnston [this message]
2025-07-10 8:55 ` [PATCH net-next v4 2/8] net: mctp: Prevent duplicate binds Matt Johnston
2025-07-15 9:50 ` Paolo Abeni
2025-07-10 8:55 ` [PATCH net-next v4 3/8] net: mctp: Treat MCTP_NET_ANY specially in bind() Matt Johnston
2025-07-10 8:55 ` [PATCH net-next v4 4/8] net: mctp: Add test for conflicting bind()s Matt Johnston
2025-07-10 8:55 ` [PATCH net-next v4 5/8] net: mctp: Use hashtable for binds Matt Johnston
2025-07-15 10:05 ` Paolo Abeni
2025-07-15 11:08 ` Matt Johnston
2025-07-10 8:55 ` [PATCH net-next v4 6/8] net: mctp: Allow limiting binds to a peer address Matt Johnston
2025-07-10 8:56 ` [PATCH net-next v4 7/8] net: mctp: Test conflicts of connect() with bind() Matt Johnston
2025-07-10 8:56 ` [PATCH net-next v4 8/8] net: mctp: Add bind lookup test Matt Johnston
2025-07-15 10:20 ` [PATCH net-next v4 0/8] net: mctp: Improved bind handling patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250710-mctp-bind-v4-1-8ec2f6460c56@codeconstruct.com.au \
--to=matt@codeconstruct.com.au \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jk@codeconstruct.com.au \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).