linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: refactor skb copy to failq in mesh_path_move_to_queue
@ 2011-08-24 19:12 John W. Linville
  2011-08-24 19:27 ` Thomas Pedersen
  0 siblings, 1 reply; 7+ messages in thread
From: John W. Linville @ 2011-08-24 19:12 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville

This seems a bit less awkward, and avoids the following warning:

  CC [M]  net/mac80211/mesh_pathtbl.o
net/mac80211/mesh_pathtbl.c: In function ‘mesh_path_move_to_queue’:
net/mac80211/mesh_pathtbl.c:291:24: warning: ‘cp_skb’ may be used uninitialized in this function

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
Does it matter if the copy ends-up on the failq before the original goes
to the gateq?

 net/mac80211/mesh_pathtbl.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 75e4b60..b5caf5b 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -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);
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-08-25 17:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-24 19:12 [PATCH] mac80211: refactor skb copy to failq in mesh_path_move_to_queue John W. Linville
2011-08-24 19:27 ` Thomas Pedersen
2011-08-24 19:32   ` John W. Linville
2011-08-24 20:06     ` Thomas Pedersen
2011-08-25  9:11       ` Kalle Valo
2011-08-25 17:02         ` Thomas Pedersen
2011-08-24 20:25     ` John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).