diff options
author | Hayes Wang <hayeswang@realtek.com> | 2023-09-08 10:01:52 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-09-11 11:58:34 +0300 |
commit | a7b8d60b37237680009dd0b025fe8c067aba0ee3 (patch) | |
tree | 794184e196f3b1272d7f1a56d2486dbc5acb3be4 /drivers/net/usb/r8152.c | |
parent | 904de9858eb4b48a217bb6e26f43c37d4c52ff36 (diff) | |
download | linux-a7b8d60b37237680009dd0b025fe8c067aba0ee3.tar.xz |
r8152: check budget for r8152_poll()
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>
Diffstat (limited to 'drivers/net/usb/r8152.c')
-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 332c853ca99b..0c13d9950cd8 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -2636,6 +2636,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) { |