提交 f6ef47e5 编写于 作者: J Jeremy Kerr 提交者: David S. Miller

mctp/test: Update refcount checking in route fragment tests

In 99ce45d5, we moved a route refcount decrement from
mctp_do_fragment_route into the caller. This invalidates the assumption
that the route test makes about refcount behaviour, so the route tests
fail.

This change fixes the test case to suit the new refcount behaviour.

Fixes: 99ce45d5 ("mctp: Implement extended addressing")
Signed-off-by: NJeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4cdf85ef
...@@ -150,11 +150,6 @@ static void mctp_test_fragment(struct kunit *test) ...@@ -150,11 +150,6 @@ static void mctp_test_fragment(struct kunit *test)
rt = mctp_test_create_route(&init_net, NULL, 10, mtu); rt = mctp_test_create_route(&init_net, NULL, 10, mtu);
KUNIT_ASSERT_TRUE(test, rt); KUNIT_ASSERT_TRUE(test, rt);
/* The refcount would usually be incremented as part of a route lookup,
* but we're setting the route directly here.
*/
refcount_inc(&rt->rt.refs);
rc = mctp_do_fragment_route(&rt->rt, skb, mtu, MCTP_TAG_OWNER); rc = mctp_do_fragment_route(&rt->rt, skb, mtu, MCTP_TAG_OWNER);
KUNIT_EXPECT_FALSE(test, rc); KUNIT_EXPECT_FALSE(test, rc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册