lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 13 Aug 2017 21:43:50 +0200
From:   Frederico Cadete <frederico@...ete.eu>
To:     gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org
Cc:     linux@...f-Entwicklungen.de, Frederico Cadete <frederico@...ete.eu>
Subject: [PATCH] staging: pi433: fix check for FDEVMSB register mask

The code was using the logical negation operator "!", effectively never
triggering the error path. To check the bitmask we should use the
bitwise negation "~".

Cleans up sparse warning:
  warning: dubious: x & !y

Signed-off-by: Frederico Cadete <frederico@...ete.eu>
---
 drivers/staging/pi433/rf69.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index f83523e3395d..e6332e1297ae 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -203,7 +203,7 @@ int rf69_set_deviation(struct spi_device *spi, u32 deviation)
 	lsb = (f_reg&0xff);
 
 	// check msb
-	if (msb & !FDEVMASB_MASK)
+	if (msb & ~FDEVMASB_MASK)
 	{
 		dev_dbg(&spi->dev, "set_deviation: err in calc of msb");
 		INVALID_PARAM;
-- 
2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ