Skip to contentSkip to conversation

net: sock: do not set sk_cookie in sk_clone_lock()

PATCH Applied Yafang Shao 2 participants 2 messages Jan 18, 2019 – Jan 19, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: sock: do not set sk_cookie in sk_clone_lock()

The only call site of sk_clone_lock is in inet_csk_clone_lock, and sk_cookie will be set there.
So we don't need to set sk_cookie in sk_clone_lock().

---
 net/core/sock.c | 1 -
 1 file changed, 1 deletion(-)
net/core/sock.c +0 -1
index f00902c..21e2a84 100644
@@ -1726,7 +1726,6 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)
 		newsk->sk_err_soft = 0;
 		newsk->sk_priority = 0;
 		newsk->sk_incoming_cpu = raw_smp_processor_id();
-		atomic64_set(&newsk->sk_cookie, 0);
 		if (likely(newsk->sk_net_refcnt))
 			sock_inuse_add(sock_net(newsk), 1);
 
Signature · 1 line
1.8.3.1