Skip to content

Commit

Permalink
[DCCP]: Call dccp_feat_init more early in dccp_v4_init_sock
Browse files Browse the repository at this point in the history
So that dccp_feat_clean doesn't get confused with uninitialized
list_heads.

Noticed when testing with no ccid kernel modules.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Mar 21, 2006
1 parent 057fc67 commit 04e2661
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions net/dccp/ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,10 @@ int dccp_v4_init_sock(struct sock *sk)
* setsockopt(CCIDs-I-want/accept). -acme
*/
if (likely(!dccp_ctl_socket_init)) {
int rc;
int rc = dccp_feat_init(sk);

if (rc)
return rc;

if (dp->dccps_options.dccpo_send_ack_vector) {
dp->dccps_hc_rx_ackvec = dccp_ackvec_alloc(GFP_KERNEL);
Expand All @@ -1075,10 +1078,6 @@ int dccp_v4_init_sock(struct sock *sk)
dp->dccps_hc_rx_ccid = dp->dccps_hc_tx_ccid = NULL;
return -ENOMEM;
}

rc = dccp_feat_init(sk);
if (rc)
return rc;
} else {
/* control socket doesn't need feat nego */
INIT_LIST_HEAD(&dp->dccps_options.dccpo_pending);
Expand Down

0 comments on commit 04e2661

Please sign in to comment.