diff options
| author | Hayes Wang <hayeswang@realtek.com> | 2023-09-08 15:01:52 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-09-19 12:20:29 +0200 |
| commit | ed584f1e72d754c2f69ece3eb08ed5734880721f (patch) | |
| tree | 524f274ae0ba70fb12286e23a10204e8c66965aa | |
| parent | 1e90a93ac4845c31724ec5dc96fb51e608435a9d (diff) | |
| download | linux-ed584f1e72d754c2f69ece3eb08ed5734880721f.tar.gz linux-ed584f1e72d754c2f69ece3eb08ed5734880721f.tar.bz2 linux-ed584f1e72d754c2f69ece3eb08ed5734880721f.zip | |
r8152: check budget for r8152_poll()
[ Upstream commit a7b8d60b37237680009dd0b025fe8c067aba0ee3 ]
According to the document of napi, there is no rx process when the
budget is 0. Therefore, r8152_poll() has to return 0 directly when the
budget is equal to 0.
Fixes: d2187f8e4454 ("r8152: divide the tx and rx bottom functions")
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | drivers/net/usb/r8152.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index f9a79d67d6d4..cc7c86debfa2 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -2439,6 +2439,9 @@ static int r8152_poll(struct napi_struct *napi, int budget) struct r8152 *tp = container_of(napi, struct r8152, napi); int work_done; + if (!budget) + return 0; + work_done = rx_bottom(tp, budget); if (work_done < budget) { |
