diff options
author | Gao Feng <fgao@ikuai8.com> | 2016-08-24 21:45:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-25 20:02:48 -0400 |
commit | b628d611a2a53858263fc419dba552f32431dba4 (patch) | |
tree | a0f36ccc5eba2cc45525c0bd55c7d72b6a1db79b | |
parent | f38ff2ee7727994685494bcc4d7c274b35b5418a (diff) |
8139cp: Fix one possible deadloop in cp_rx_poll
When cp_rx_poll does not get enough packet, it will check the rx
interrupt status again. If so, it will jumpt to rx_status_loop again.
But the goto jump resets the rx variable as zero too.
As a result, it causes one possible deadloop. Assume this case,
rx_status_loop only gets the packet count which is less than budget,
and (cpr16(IntrStatus) & cp_rx_intr_mask) condition is always true.
It causes the deadloop happens and system is blocked.
Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/realtek/8139cp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c index deae10d7426d..5297bf77211c 100644 --- a/drivers/net/ethernet/realtek/8139cp.c +++ b/drivers/net/ethernet/realtek/8139cp.c | |||
@@ -467,8 +467,8 @@ static int cp_rx_poll(struct napi_struct *napi, int budget) | |||
467 | unsigned int rx_tail = cp->rx_tail; | 467 | unsigned int rx_tail = cp->rx_tail; |
468 | int rx; | 468 | int rx; |
469 | 469 | ||
470 | rx_status_loop: | ||
471 | rx = 0; | 470 | rx = 0; |
471 | rx_status_loop: | ||
472 | cpw16(IntrStatus, cp_rx_intr_mask); | 472 | cpw16(IntrStatus, cp_rx_intr_mask); |
473 | 473 | ||
474 | while (rx < budget) { | 474 | while (rx < budget) { |