mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
net: Introduce sk_clone_lock() error path routine
When handling problems in cloning a socket with the sk_clone_locked() function we need to perform several steps that were open coded in it and its callers, so introduce a routine to avoid this duplication: sk_free_unlock_clone(). Cc: Cong Wang <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: Gerrit Renker <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
d5afb6f9b6
commit
94352d4509
3 changed files with 13 additions and 10 deletions
|
|
@ -119,11 +119,7 @@ struct sock *dccp_create_openreq_child(const struct sock *sk,
|
|||
* Activate features: initialise CCIDs, sequence windows etc.
|
||||
*/
|
||||
if (dccp_feat_activate_values(newsk, &dreq->dreq_featneg)) {
|
||||
/* It is still raw copy of parent, so invalidate
|
||||
* destructor and make plain sk_free() */
|
||||
newsk->sk_destruct = NULL;
|
||||
bh_unlock_sock(newsk);
|
||||
sk_free(newsk);
|
||||
sk_free_unlock_clone(newsk);
|
||||
return NULL;
|
||||
}
|
||||
dccp_init_xmit_timers(newsk);
|
||||
|
|
|
|||
Loading…
Reference in a new issue