Skip to content

Commit

Permalink
drivers/net: starfire: Fix napi ->poll() weight handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Dec 16, 2008
1 parent bb5f133 commit 9a3de25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/starfire.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9a3de25

Please sign in to comment.