Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/af_iucv: don't lookup the socket on TX notification

Whoever called iucv_sk(sk)->sk_txnotify() must already know that they're
dealing with an af_iucv socket.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Julian Wiedmann and committed by
Jakub Kicinski
c464444f 27e9c1de

+3 -12
+3 -12
net/iucv/af_iucv.c
··· 2134 2134 static void afiucv_hs_callback_txnotify(struct sk_buff *skb, 2135 2135 enum iucv_tx_notify n) 2136 2136 { 2137 - struct sock *isk = skb->sk; 2138 - struct sock *sk = NULL; 2139 - struct iucv_sock *iucv = NULL; 2137 + struct iucv_sock *iucv = iucv_sk(skb->sk); 2138 + struct sock *sk = skb->sk; 2140 2139 struct sk_buff_head *list; 2141 2140 struct sk_buff *list_skb; 2142 2141 struct sk_buff *nskb; 2143 2142 unsigned long flags; 2144 2143 2145 - read_lock_irqsave(&iucv_sk_list.lock, flags); 2146 - sk_for_each(sk, &iucv_sk_list.head) 2147 - if (sk == isk) { 2148 - iucv = iucv_sk(sk); 2149 - break; 2150 - } 2151 - read_unlock_irqrestore(&iucv_sk_list.lock, flags); 2152 - 2153 - if (!iucv || sock_flag(sk, SOCK_ZAPPED)) 2144 + if (sock_flag(sk, SOCK_ZAPPED)) 2154 2145 return; 2155 2146 2156 2147 list = &iucv->send_skb_q;