Skip to content

Commit a7b8d60

Browse files
hayesorzdavem330
authored andcommitted
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: d2187f8 ("r8152: divide the tx and rx bottom functions") Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 904de98 commit a7b8d60

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/usb/r8152.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,6 +2636,9 @@ static int r8152_poll(struct napi_struct *napi, int budget)
26362636
struct r8152 *tp = container_of(napi, struct r8152, napi);
26372637
int work_done;
26382638

2639+
if (!budget)
2640+
return 0;
2641+
26392642
work_done = rx_bottom(tp, budget);
26402643

26412644
if (work_done < budget) {

0 commit comments

Comments
 (0)