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>] [day] [month] [year] [list]
Message-Id: <1434322774-30194-1-git-send-email-gascoar@gmail.com>
Date:	Sun, 14 Jun 2015 19:59:34 -0300
From:	Gaston Gonzalez <gascoar@...il.com>
To:	gregkh@...uxfoundation.org
Cc:	cristina.opriceana@...il.com, gdonald@...il.com,
	hamohammed.sa@...il.com, mahfouz.saif.elyazal@...il.com,
	paul.gortmaker@...driver.com, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org, gascoar@...il.com
Subject: [PATCH] staging: rtl8192u: ieee80211: Fix incorrect type in assignment

Added le16_to_cpu() conversion fixing the following warning in assignment detected by sparse: 

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30: warning: invalid assignment: +=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30:    left side has type unsigned long
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30:    right side has type restricted __le16

Signed-off-by: Gaston Gonzalez <gascoar@...il.com>
---
 I wonder if this is the best approach, making payload_size u16 in ieee80211.h would fix this plus other three sparse warnings. Could we make payload_size u16 or it must be definitely le16?

 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 5fbade4..1b11acb 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -2154,7 +2154,7 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb, struct ieee80211_device *
 	ieee80211_sta_wakeup(ieee, 0);
 
 	/* update the tx status */
-	ieee->stats.tx_bytes += txb->payload_size;
+	ieee->stats.tx_bytes += le16_to_cpu(txb->payload_size);
 	ieee->stats.tx_packets++;
 	tcb_desc = (cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE);
 	if (tcb_desc->bMulticast) {
-- 
2.4.2

--
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