aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2008-12-16 15:42:20 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-14 09:44:07 -0800
commit9d8ce36fb8cd27442e1b700f3068908a63de2fff (patch)
treed74e04c113fc584ce4a9471f202dd0547f2ad0ab /drivers
parent398604a3a6b864d7a09c67772a7d44cf88ce24a0 (diff)
drivers/net: starfire: Fix napi ->poll() weight handling
commit 9a3de25544dadab1971847f28f33b1cd0d1770a6 upstream. 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> Cc: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/starfire.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index 1d2ef8f4778..5a40f2d78be 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: