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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1443615131-18867-1-git-send-email-luisbg@osg.samsung.com>
Date:	Wed, 30 Sep 2015 13:12:11 +0100
From:	Luis de Bethencourt <luisbg@....samsung.com>
To:	linux-kernel@...r.kernel.org
Cc:	gregkh@...uxfoundation.org, mateusz.kulikowski@...il.com,
	cristina.opriceana@...il.com, devel@...verdev.osuosl.org,
	Luis de Bethencourt <luisbg@....samsung.com>
Subject: [PATCH] staging: rtl8192e: rtl_wx: fix negative noise value

wstats->qual.noise is of type uint8, so it shouldn't be assigned a
negative number. Assigning it 0x100 - 100, which is the equivalent
to -100 dBm when IW_QUAL_DBM is set.

Signed-off-by: Luis de Bethencourt <luisbg@....samsung.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 984cb9a..70df6a1 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -1225,7 +1225,7 @@ static struct iw_statistics *_rtl92e_get_wireless_stats(struct net_device *dev)
 	if (ieee->state < RTLLIB_LINKED) {
 		wstats->qual.qual = 10;
 		wstats->qual.level = 0;
-		wstats->qual.noise = -100;
+		wstats->qual.noise = 0x100 - 100;	/* -100 dBm */
 		wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
 		return wstats;
 	}
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ