diff mbox series

[net,1/1] net: ipa: don't be a hog in gsi_channel_poll()

Message ID 20200515195203.24947-1-elder@linaro.org
State Accepted
Delegated to: David Miller
Headers show
Series [net,1/1] net: ipa: don't be a hog in gsi_channel_poll() | expand

Commit Message

Alex Elder May 15, 2020, 7:52 p.m. UTC
The iteration count value used in gsi_channel_poll() is intended to
limit poll iterations to the budget supplied as an argument.  But
it's never updated.

Fix this bug by incrementing the count each time through the loop.

Reported-by: Sharath Chandra Vurukala <sharathv@codeaurora.com>
Signed-off-by: Alex Elder <elder@linaro.org>
---
 drivers/net/ipa/gsi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Miller May 16, 2020, 10:16 p.m. UTC | #1
From: Alex Elder <elder@linaro.org>
Date: Fri, 15 May 2020 14:52:03 -0500

> The iteration count value used in gsi_channel_poll() is intended to
> limit poll iterations to the budget supplied as an argument.  But
> it's never updated.
> 
> Fix this bug by incrementing the count each time through the loop.
> 
> Reported-by: Sharath Chandra Vurukala <sharathv@codeaurora.com>
> Signed-off-by: Alex Elder <elder@linaro.org>

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
index b671bea0aa7c..8d9ca1c335e8 100644
--- a/drivers/net/ipa/gsi.c
+++ b/drivers/net/ipa/gsi.c
@@ -1392,6 +1392,7 @@  static int gsi_channel_poll(struct napi_struct *napi, int budget)
 	while (count < budget) {
 		struct gsi_trans *trans;
 
+		count++;
 		trans = gsi_channel_poll_one(channel);
 		if (!trans)
 			break;