[rfc | patch 6/6] netpoll: fix deadlock in arp_reply

From: Jeff Moyer
Date: Fri Jul 01 2005 - 18:21:41 EST


This fixes an obvious deadlock in the netpoll code. netpoll_rx takes the
npinfo->rx_lock. netpoll_rx is also the only caller of arp_reply (through
__netpoll_rx). As such, it is not necessary to take this lock.

Signed-off-by: Jeff Moyer <jmoyer@xxxxxxxxxx>

--- linux-2.6.12/net/core/netpoll.c.orig 2005-07-01 17:55:24.313339068 -0400
+++ linux-2.6.12/net/core/netpoll.c 2005-07-01 17:55:57.354863472 -0400
@@ -370,11 +370,8 @@ static void arp_reply(struct sk_buff *sk
struct sk_buff *send_skb;
struct netpoll *np = NULL;

- spin_lock_irqsave(&npinfo->rx_lock, flags);
if (npinfo->rx_np && npinfo->rx_np->dev == skb->dev)
np = npinfo->rx_np;
- spin_unlock_irqrestore(&npinfo->rx_lock, flags);
-
if (!np)
return;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/