diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2008-12-17 00:42:20 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-17 00:42:20 +0100 |
commit | 9a3de25544dadab1971847f28f33b1cd0d1770a6 (patch) | |
tree | cf5f2cfe90b0b05f45f2625d99d130a0a5c30f9b /drivers/net/starfire.c | |
parent | tlan: Fix pci memory unmapping (diff) | |
download | linux-9a3de25544dadab1971847f28f33b1cd0d1770a6.tar.xz linux-9a3de25544dadab1971847f28f33b1cd0d1770a6.zip |
drivers/net: starfire: Fix napi ->poll() weight handling
starfire napi ->poll() handler can return work == weight after calling
netif_rx_complete() (if there is no more work). It is illegal and this
patch fixes it.
Reported-by: Alexander Huemer <alexander.huemer@sbg.ac.at>
Tested-by: Alexander Huemer <alexander.huemer@sbg.ac.at>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/starfire.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index 1d2ef8f47780..5a40f2d78beb 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c @@ -1509,6 +1509,11 @@ static int __netdev_rx(struct net_device *dev, int *quota) desc->status = 0; np->rx_done = (np->rx_done + 1) % DONE_Q_SIZE; } + + if (*quota == 0) { /* out of rx quota */ + retcode = 1; + goto out; + } writew(np->rx_done, np->base + CompletionQConsumerIdx); out: |