Skip to content

Commit ce335db

Browse files
jk-ozlabskuba-moo
authored andcommitted
net: mctp: test: Use correct skb for route input check
In the MCTP route input test, we're routing one skb, then (when delivery is expected) checking the resulting routed skb. However, we're currently checking the original skb length, rather than the routed skb. Check the routed skb instead; the original will have been freed at this point. Fixes: 8892c04 ("mctp: Add route input to socket tests") Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/kernel-janitors/[email protected]/ Signed-off-by: Jeremy Kerr <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/20240816-mctp-kunit-skb-fix-v1-1-3c367ac89c27@codeconstruct.com.au Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 565d121 commit ce335db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/mctp/test/route-test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ static void mctp_test_route_input_sk(struct kunit *test)
366366

367367
skb2 = skb_recv_datagram(sock->sk, MSG_DONTWAIT, &rc);
368368
KUNIT_EXPECT_NOT_ERR_OR_NULL(test, skb2);
369-
KUNIT_EXPECT_EQ(test, skb->len, 1);
369+
KUNIT_EXPECT_EQ(test, skb2->len, 1);
370370

371371
skb_free_datagram(sock->sk, skb2);
372372

0 commit comments

Comments
 (0)