linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: mana: Use int to check the return value of mana_gd_poll_cq()
@ 2021-04-22 20:08 Dexuan Cui
  2021-04-23 20:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Dexuan Cui @ 2021-04-22 20:08 UTC (permalink / raw)
  To: davem, kuba, kys, haiyangz, stephen, sthemmin, wei.liu, liuwe,
	netdev, dan.carpenter
  Cc: linux-kernel, linux-hyperv, Dexuan Cui

mana_gd_poll_cq() may return -1 if an overflow error is detected (this
should never happen unless there is a bug in the driver or the hardware).

Fix the type of the variable "comp_read" by using int rather than u32.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
 drivers/net/ethernet/microsoft/mana/hw_channel.c | 2 +-
 drivers/net/ethernet/microsoft/mana/mana_en.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/microsoft/mana/hw_channel.c b/drivers/net/ethernet/microsoft/mana/hw_channel.c
index 0cf0322702ed..1a923fd99990 100644
--- a/drivers/net/ethernet/microsoft/mana/hw_channel.c
+++ b/drivers/net/ethernet/microsoft/mana/hw_channel.c
@@ -283,7 +283,7 @@ static void mana_hwc_comp_event(void *ctx, struct gdma_queue *q_self)
 	struct hwc_rx_oob comp_data = {};
 	struct gdma_comp *completions;
 	struct hwc_cq *hwc_cq = ctx;
-	u32 comp_read, i;
+	int comp_read, i;
 
 	WARN_ON_ONCE(hwc_cq->gdma_cq != q_self);
 
diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index a744ca0b6c19..04d067243457 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -1061,7 +1061,7 @@ static void mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq,
 static void mana_poll_rx_cq(struct mana_cq *cq)
 {
 	struct gdma_comp *comp = cq->gdma_comp_buf;
-	u32 comp_read, i;
+	int comp_read, i;
 
 	comp_read = mana_gd_poll_cq(cq->gdma_cq, comp, CQE_POLLING_BUFFER);
 	WARN_ON_ONCE(comp_read > CQE_POLLING_BUFFER);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: mana: Use int to check the return value of mana_gd_poll_cq()
  2021-04-22 20:08 [PATCH net-next] net: mana: Use int to check the return value of mana_gd_poll_cq() Dexuan Cui
@ 2021-04-23 20:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-04-23 20:30 UTC (permalink / raw)
  To: Dexuan Cui
  Cc: davem, kuba, kys, haiyangz, stephen, sthemmin, wei.liu, liuwe,
	netdev, dan.carpenter, linux-kernel, linux-hyperv

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Thu, 22 Apr 2021 13:08:16 -0700 you wrote:
> mana_gd_poll_cq() may return -1 if an overflow error is detected (this
> should never happen unless there is a bug in the driver or the hardware).
> 
> Fix the type of the variable "comp_read" by using int rather than u32.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> 
> [...]

Here is the summary with links:
  - [net-next] net: mana: Use int to check the return value of mana_gd_poll_cq()
    https://git.kernel.org/netdev/net-next/c/d90a94680bc0

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-23 20:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22 20:08 [PATCH net-next] net: mana: Use int to check the return value of mana_gd_poll_cq() Dexuan Cui
2021-04-23 20:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).