From: Jarek Poplawski Date: Tue, 16 Dec 2008 23:42:20 +0000 (-0800) Subject: drivers/net: starfire: Fix napi ->poll() weight handling X-Git-Tag: v2.6.28-rc9~3^2~4 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=9a3de25544dadab1971847f28f33b1cd0d1770a6;p=linux-2.6-omap-h63xx.git 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 Tested-by: Alexander Huemer Signed-off-by: Jarek Poplawski Signed-off-by: David S. Miller --- 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: