Skip to content

Commit ade4d75

Browse files
menglongdongdavem330
authored andcommitted
mptcp: init sk->sk_prot in build_msk()
The 'sk_prot' field in token KUNIT self-tests will be dereferenced in mptcp_token_new_connect(). Therefore, init it with tcp_prot. Acked-by: Paolo Abeni <[email protected]> Signed-off-by: Menglong Dong <[email protected]> Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cfdcfee commit ade4d75

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/mptcp/token_test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ static struct mptcp_sock *build_msk(struct kunit *test)
5757
KUNIT_EXPECT_NOT_ERR_OR_NULL(test, msk);
5858
refcount_set(&((struct sock *)msk)->sk_refcnt, 1);
5959
sock_net_set((struct sock *)msk, &init_net);
60+
61+
/* be sure the token helpers can dereference sk->sk_prot */
62+
((struct sock *)msk)->sk_prot = &tcp_prot;
6063
return msk;
6164
}
6265

0 commit comments

Comments
 (0)