]> git.baikalelectronics.ru Git - kernel.git/commit
net: hp100: fix always-true check for link up state
authorColin Ian King <colin.king@canonical.com>
Fri, 14 Sep 2018 16:39:53 +0000 (17:39 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Sep 2018 14:55:19 +0000 (07:55 -0700)
commit729a8dac50fb7e95b67ec85687e8a66f5f35f0e6
tree268980605e8b77fcc841c6797bf7c3af49e7a7f3
parent5548c1013a68c8bce6089aaebab64bf299c09d40
net: hp100: fix always-true check for link up state

The operation ~(p100_inb(VG_LAN_CFG_1) & HP100_LINK_UP) returns a value
that is always non-zero and hence the wait for the link to drop always
terminates prematurely.  Fix this by using a logical not operator instead
of a bitwise complement.  This issue has been in the driver since
pre-2.6.12-rc2.

Detected by CoverityScan, CID#114157 ("Logical vs. bitwise operator")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hp/hp100.c