From bbd5898d39ab9f855c732f6f07e40e95b05cf52a Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Mon, 1 Jun 2009 00:35:16 +0000 Subject: [PATCH] Phonet: fix accounting race between gprs_writeable() and gprs_xmit() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: David S. Miller --- net/phonet/pep-gprs.c | 5 +++-- 1 file 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; } -- 2.34.1