]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: mana: Use int to check the return value of mana_gd_poll_cq()
authorDexuan Cui <decui@microsoft.com>
Thu, 22 Apr 2021 20:08:16 +0000 (13:08 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Apr 2021 20:16:29 +0000 (13:16 -0700)
commitd90a94680bc0a8069d93282bc5f2966d00b9c4a4
treed1e50206b907c6c35775ac4eaf74ff3eb467eb89
parentf80bd740cb7c954791279590b2e810ba6c214e52
net: mana: Use int to check the return value of mana_gd_poll_cq()

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/microsoft/mana/hw_channel.c
drivers/net/ethernet/microsoft/mana/mana_en.c