Skip to content

Commit

Permalink
Phonet: fix accounting race between gprs_writeable() and gprs_xmit()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Rémi Denis-Courmont authored and davem330 committed Jun 2, 2009
1 parent c930a66 commit bbd5898
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/phonet/pep-gprs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit bbd5898

Please sign in to comment.