@@ -1873,30 +1873,26 @@ static void iucv_callback_txdone(struct iucv_path *path,
1873
1873
struct sock * sk = path -> private ;
1874
1874
struct sk_buff * this = NULL ;
1875
1875
struct sk_buff_head * list = & iucv_sk (sk )-> send_skb_q ;
1876
- struct sk_buff * list_skb = list -> next ;
1876
+ struct sk_buff * list_skb ;
1877
1877
unsigned long flags ;
1878
1878
1879
1879
bh_lock_sock (sk );
1880
- if (!skb_queue_empty (list )) {
1881
- spin_lock_irqsave (& list -> lock , flags );
1882
1880
1883
- while (list_skb != (struct sk_buff * )list ) {
1884
- if (msg -> tag == IUCV_SKB_CB (list_skb )-> tag ) {
1885
- this = list_skb ;
1886
- break ;
1887
- }
1888
- list_skb = list_skb -> next ;
1881
+ spin_lock_irqsave (& list -> lock , flags );
1882
+ skb_queue_walk (list , list_skb ) {
1883
+ if (msg -> tag == IUCV_SKB_CB (list_skb )-> tag ) {
1884
+ this = list_skb ;
1885
+ break ;
1889
1886
}
1890
- if ( this )
1891
- __skb_unlink (this , list );
1892
-
1893
- spin_unlock_irqrestore (& list -> lock , flags );
1887
+ }
1888
+ if (this )
1889
+ __skb_unlink ( this , list );
1890
+ spin_unlock_irqrestore (& list -> lock , flags );
1894
1891
1895
- if (this ) {
1896
- kfree_skb (this );
1897
- /* wake up any process waiting for sending */
1898
- iucv_sock_wake_msglim (sk );
1899
- }
1892
+ if (this ) {
1893
+ kfree_skb (this );
1894
+ /* wake up any process waiting for sending */
1895
+ iucv_sock_wake_msglim (sk );
1900
1896
}
1901
1897
1902
1898
if (sk -> sk_state == IUCV_CLOSING ) {
@@ -2284,11 +2280,7 @@ static void afiucv_hs_callback_txnotify(struct sk_buff *skb,
2284
2280
2285
2281
list = & iucv -> send_skb_q ;
2286
2282
spin_lock_irqsave (& list -> lock , flags );
2287
- if (skb_queue_empty (list ))
2288
- goto out_unlock ;
2289
- list_skb = list -> next ;
2290
- nskb = list_skb -> next ;
2291
- while (list_skb != (struct sk_buff * )list ) {
2283
+ skb_queue_walk_safe (list , list_skb , nskb ) {
2292
2284
if (skb_shinfo (list_skb ) == skb_shinfo (skb )) {
2293
2285
switch (n ) {
2294
2286
case TX_NOTIFY_OK :
@@ -2321,10 +2313,7 @@ static void afiucv_hs_callback_txnotify(struct sk_buff *skb,
2321
2313
}
2322
2314
break ;
2323
2315
}
2324
- list_skb = nskb ;
2325
- nskb = nskb -> next ;
2326
2316
}
2327
- out_unlock :
2328
2317
spin_unlock_irqrestore (& list -> lock , flags );
2329
2318
2330
2319
if (sk -> sk_state == IUCV_CLOSING ) {
0 commit comments