Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1444683 > unrolled thread

[PATCH net] et131x: Fix logical vs bitwise check in et131x_tx_timeout()

Started byFlorian Fainelli <f.fainelli@gmail.com>
First post2016-07-16 01:50 +0200
Last post2016-07-17 07:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net] et131x: Fix logical vs bitwise check in et131x_tx_timeout() Florian Fainelli <f.fainelli@gmail.com> - 2016-07-16 01:50 +0200
    Re: [PATCH net] et131x: Fix logical vs bitwise check in  et131x_tx_timeout() David Miller <davem@davemloft.net> - 2016-07-17 07:10 +0200

#1444683 — [PATCH net] et131x: Fix logical vs bitwise check in et131x_tx_timeout()

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2016-07-16 01:50 +0200
Subject[PATCH net] et131x: Fix logical vs bitwise check in et131x_tx_timeout()
Message-ID<rVl1M-4Mo-35@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1445013 — Re: [PATCH net] et131x: Fix logical vs bitwise check in et131x_tx_timeout()

FromDavid Miller <davem@davemloft.net>
Date2016-07-17 07:10 +0200
SubjectRe: [PATCH net] et131x: Fix logical vs bitwise check in et131x_tx_timeout()
Message-ID<rVMuZ-538-1@gated-at.bofh.it>
In reply to#1444683
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.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web