3737/* 1st Level Abstractions. */
3838
3939/* Initialize a new transport from provided memory. */
40- static struct sctp_transport * sctp_transport_init (struct net * net ,
41- struct sctp_transport * peer ,
42- const union sctp_addr * addr ,
43- gfp_t gfp )
40+ static void sctp_transport_init (struct net * net ,
41+ struct sctp_transport * peer ,
42+ const union sctp_addr * addr ,
43+ gfp_t gfp )
4444{
4545 /* Copy in the address. */
4646 peer -> af_specific = sctp_get_af_specific (addr -> sa .sa_family );
@@ -83,8 +83,6 @@ static struct sctp_transport *sctp_transport_init(struct net *net,
8383 get_random_bytes (& peer -> hb_nonce , sizeof (peer -> hb_nonce ));
8484
8585 refcount_set (& peer -> refcnt , 1 );
86-
87- return peer ;
8886}
8987
9088/* Allocate and initialize a new transport. */
@@ -96,20 +94,13 @@ struct sctp_transport *sctp_transport_new(struct net *net,
9694
9795 transport = kzalloc (sizeof (* transport ), gfp );
9896 if (!transport )
99- goto fail ;
97+ return NULL ;
10098
101- if (!sctp_transport_init (net , transport , addr , gfp ))
102- goto fail_init ;
99+ sctp_transport_init (net , transport , addr , gfp );
103100
104101 SCTP_DBG_OBJCNT_INC (transport );
105102
106103 return transport ;
107-
108- fail_init :
109- kfree (transport );
110-
111- fail :
112- return NULL ;
113104}
114105
115106/* This transport is no longer needed. Free up if possible, or
0 commit comments