diff options
author | Rémi Denis-Courmont <remi.denis-courmont@nokia.com> | 2009-06-01 02:35:16 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-02 09:17:43 +0200 |
commit | bbd5898d39ab9f855c732f6f07e40e95b05cf52a (patch) | |
tree | 383f8dc9aa4727269693d1442c83dd780161c177 /net/phonet/pep-gprs.c | |
parent | atl1c_main.c: add wait_for_idle routine (diff) | |
download | linux-bbd5898d39ab9f855c732f6f07e40e95b05cf52a.tar.xz linux-bbd5898d39ab9f855c732f6f07e40e95b05cf52a.zip |
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>
Diffstat (limited to 'net/phonet/pep-gprs.c')
-rw-r--r-- | net/phonet/pep-gprs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/phonet/pep-gprs.c b/net/phonet/pep-gprs.c index 4aa888584d20..851f6a3f8ddd 100644 --- a/net/phonet/pep-gprs.c +++ b/net/phonet/pep-gprs.c @@ -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; } |