RXRPC: Use skb_queue_walk_safe()
Subsystems (3)
PATCH 1/1 RXRPC: Use skb_queue_walk_safe()
Because the list could be modified inside the loop, use skb_queue_walk_safe().
Signed-off-by Wang Chen <[email protected]>
--- net/rxrpc/ar-ack.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
net/rxrpc/ar-ack.c +2 -1
@@ -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",
Signature · 1 line
1.5.4.rc3
David Howells
maintainerQuoted 2 lines · Wang Chen
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