* [PATCH] RXRPC: Use skb_queue_walk_safe()
@ 2008-05-22 10:05 Wang Chen
2008-05-22 14:10 ` David Howells
0 siblings, 1 reply; 2+ messages in thread
From: Wang Chen @ 2008-05-22 10:05 UTC (permalink / raw)
To: dhowells; +Cc: linux-afs, NETDEV, David S. Miller
Because the list could be modified inside the loop, use
skb_queue_walk_safe().
Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
net/rxrpc/ar-ack.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c
index 3ac1672..cbd70d1 100644
--- a/net/rxrpc/ar-ack.c
+++ b/net/rxrpc/ar-ack.c
@@ -468,6 +468,7 @@ static void rxrpc_insert_oos_packet(struct rxrpc_call *call,
{
struct rxrpc_skb_priv *sp, *psp;
struct sk_buff *p;
+ struct sk_buff *tmp;
u32 seq;
sp = rxrpc_skb(skb);
@@ -482,7 +483,7 @@ static void rxrpc_insert_oos_packet(struct rxrpc_call *call,
/* insert into the buffer in sequence order */
spin_lock_bh(&call->lock);
- skb_queue_walk(&call->rx_oos_queue, p) {
+ skb_queue_walk_safe(&call->rx_oos_queue, p, tmp) {
psp = rxrpc_skb(p);
if (ntohl(psp->hdr.seq) > seq) {
_debug("insert oos #%u before #%u",
--
1.5.4.rc3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] RXRPC: Use skb_queue_walk_safe()
2008-05-22 10:05 [PATCH] RXRPC: Use skb_queue_walk_safe() Wang Chen
@ 2008-05-22 14:10 ` David Howells
0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2008-05-22 14:10 UTC (permalink / raw)
To: Wang Chen; +Cc: dhowells, linux-afs, NETDEV, David S. Miller
Wang Chen <wangchen@cn.fujitsu.com> wrote:
> Because the list could be modified inside the loop, use
> skb_queue_walk_safe().
This is unnecessary. If skb_insert() is called in the loop, the very next
line is a goto that exits the loop immediately.
David
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-05-22 14:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-22 10:05 [PATCH] RXRPC: Use skb_queue_walk_safe() Wang Chen
2008-05-22 14:10 ` David Howells
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).