All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] et131x: Fix logical vs bitwise check in et131x_tx_timeout()
@ 2016-07-15 23:40 Florian Fainelli
  2016-07-17  5:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2016-07-15 23:40 UTC (permalink / raw)
  To: netdev
  Cc: davem, Florian Fainelli, Mark Einon, Andrew Lunn,
	Antonio Quartulli, Felipe Balbi, Florian Westphal, Insu Yun,
	open list

We should be using a logical check here instead of a bitwise operation
to check if the device is closed already in et131x_tx_timeout().

Reported-by: coverity (CID 146498)
Fixes: 38df6492eb511 ("et131x: Add PCIe gigabit ethernet driver et131x to drivers/net")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/agere/et131x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/agere/et131x.c b/drivers/net/ethernet/agere/et131x.c
index 30defe6c81f2..821d86c38ab2 100644
--- a/drivers/net/ethernet/agere/et131x.c
+++ b/drivers/net/ethernet/agere/et131x.c
@@ -3851,7 +3851,7 @@ static void et131x_tx_timeout(struct net_device *netdev)
 	unsigned long flags;
 
 	/* If the device is closed, ignore the timeout */
-	if (~(adapter->flags & FMP_ADAPTER_INTERRUPT_IN_USE))
+	if (!(adapter->flags & FMP_ADAPTER_INTERRUPT_IN_USE))
 		return;
 
 	/* Any nonrecoverable hardware error?
-- 
2.7.4

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

* Re: [PATCH net] et131x: Fix logical vs bitwise check in et131x_tx_timeout()
  2016-07-15 23:40 [PATCH net] et131x: Fix logical vs bitwise check in et131x_tx_timeout() Florian Fainelli
@ 2016-07-17  5:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-07-17  5:04 UTC (permalink / raw)
  To: f.fainelli
  Cc: netdev, mark.einon, andrew, a, felipe.balbi, fw, wuninsu, linux-kernel

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 15 Jul 2016 16:40:22 -0700

> We should be using a logical check here instead of a bitwise operation
> to check if the device is closed already in et131x_tx_timeout().
> 
> Reported-by: coverity (CID 146498)
> Fixes: 38df6492eb511 ("et131x: Add PCIe gigabit ethernet driver et131x to drivers/net")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied.

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

end of thread, other threads:[~2016-07-17  5:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15 23:40 [PATCH net] et131x: Fix logical vs bitwise check in et131x_tx_timeout() Florian Fainelli
2016-07-17  5:04 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.