net/core: Collapse redundant sk_timer callback data
Subsystems (4)
PATCH 1/1 net/core: Collapse redundant sk_timer callback data
The core sk_timer initializer can provide the common .data assignment instead of it being set separately in users.
Cc "David S. Miller" <[email protected]>
Cc Ralf Baechle <[email protected]>
Cc Andrew Hendry <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Paolo Abeni <[email protected]>
Cc David Howells <[email protected]>
Cc Colin Ian King <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc linzhang <[email protected]>
Cc Thomas Gleixner <[email protected]>
Signed-off-by Kees Cook <[email protected]>
---
This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone.
--- net/core/sock.c | 2 +- net/netrom/nr_timer.c | 1 - net/rose/rose_timer.c | 1 - net/x25/af_x25.c | 1 - net/x25/x25_timer.c | 1 - 5 files changed, 1 insertion(+), 5 deletions(-)
net/core/sock.c +1 -1
@@ -2678,7 +2678,7 @@ void sock_init_data(struct socket *sock, struct sock *sk)sk_init_common (sk); sk->sk_send_head =NULL ; -init_timer (&sk->sk_timer); +setup_timer (&sk->sk_timer,NULL , (unsigned long )sk); sk->sk_allocation =GFP_KERNEL ; sk->sk_rcvbuf = sysctl_rmem_default;
net/netrom/nr_timer.c +0 -1
@@ -45,7 +45,6 @@ void nr_init_timers(struct sock *sk)setup_timer (&nr->idletimer, nr_idletimer_expiry, (unsigned long )sk);/* initialized by sock_init_data */ - sk->sk_timer.data = (unsigned long )sk; sk->sk_timer.function = &nr_heartbeat_expiry; }
net/rose/rose_timer.c +0 -1
@@ -36,7 +36,6 @@ void rose_start_heartbeat(struct sock *sk) {del_timer (&sk->sk_timer); - sk->sk_timer.data = (unsigned long )sk; sk->sk_timer.function = &rose_heartbeat_expiry; sk->sk_timer.expires = jiffies +5 *HZ ;
net/x25/af_x25.c +0 -1
@@ -414,7 +414,6 @@ static void __x25_destroy_socket(struct sock *sk)/* Defer: outstanding buffers */ sk->sk_timer.expires = jiffies +10 *HZ ; sk->sk_timer.function = x25_destroy_timer; - sk->sk_timer.data = (unsigned long )sk;add_timer (&sk->sk_timer); }else {/* drop last reference so sock_put will free */
net/x25/x25_timer.c +0 -1
@@ -36,7 +36,6 @@ void x25_init_timers(struct sock *sk)setup_timer (&x25->timer, x25_timer_expiry, (unsigned long )sk);/* initialized by sock_init_data */ - sk->sk_timer.data = (unsigned long )sk; sk->sk_timer.function = &x25_heartbeat_expiry; }
Signature · 6 lines
2.7.4 -- Kees Cook Pixel Security