Phonet: fix accounting race between gprs_writeable() and gprs_xmit()

In the unlikely event that gprs_writeable() and gprs_xmit() check for
writeability at the same, we could stop the device queue forever.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Rémi Denis-Courmont 2009-06-01 00:35:16 +00:00 committed by David S. Miller
parent c930a66220
commit bbd5898d39
1 changed files with 3 additions and 2 deletions

View File

@ -212,8 +212,9 @@ static int gprs_xmit(struct sk_buff *skb, struct net_device *dev)
dev->stats.tx_bytes += len;
}
if (!pep_writeable(sk))
netif_stop_queue(dev);
netif_stop_queue(dev);
if (pep_writeable(sk))
netif_wake_queue(dev);
return 0;
}