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: v3.12-rc1~16904^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a3de25544dadab1971847f28f33b1cd0d1770a6;p=kernel%2Fkernel-generic.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 1d2ef8f..5a40f2d 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: