mac80211: refactor skb copy to failq in mesh_path_move_to_queue
authorJohn W. Linville <linville@tuxdriver.com>
Wed, 24 Aug 2011 19:12:41 +0000 (15:12 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 29 Aug 2011 19:25:28 +0000 (15:25 -0400)
This seems a bit less awkward...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/mesh_pathtbl.c

index 3c2bcb2de844c4314ec712744921dac89c01d526..ede4f5242e0b7e1be9fc36cbda954a8ed9d7e5c0 100644 (file)
@@ -307,14 +307,14 @@ static void mesh_path_move_to_queue(struct mesh_path *gate_mpath,
 
        while (num_skbs--) {
                skb = __skb_dequeue(&failq);
-               if (copy)
+               if (copy) {
                        cp_skb = skb_copy(skb, GFP_ATOMIC);
+                       if (cp_skb)
+                               __skb_queue_tail(&failq, cp_skb);
+               }
 
                prepare_for_gate(skb, gate_mpath->dst, gate_mpath);
                __skb_queue_tail(&gateq, skb);
-
-               if (copy && cp_skb)
-                       __skb_queue_tail(&failq, cp_skb);
        }
 
        spin_lock_irqsave(&gate_mpath->frame_queue.lock, flags);