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: <1434649791-4730-1-git-send-email-bilel.dr@gmail.com>
Date:	Thu, 18 Jun 2015 18:49:51 +0100
From:	Bilel DRIRA <bilel.dr@...il.com>
To:	gregkh@...uxfoundation.org, eng.douglasfigueiredo@...il.com,
	matt@...ezulu.com, josh@...htriplett.org, raghav3276@...il.com,
	tapaswenipathak@...il.com, artemiyv@....org
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	Bilel DRIRA <bilel.dr@...il.com>
Subject: [PATCH] staging: wlan-ng: Fix memset warning found by sparse

This patch fixes the following sparse warnings:

drivers/staging/wlan-ng/prism2fw.c:251:15: warning: memset with byte count of 120000
drivers/staging/wlan-ng/prism2fw.c:470:15: warning: memset with byte count of 120000

Signed-off-by: Bilel DRIRA <bilel.dr@...il.com>
---
 drivers/staging/wlan-ng/prism2fw.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index fe36613589ae..7652ca70da1b 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -245,10 +245,12 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr,
 	struct p80211msg_dot11req_mibget getmsg;
 	p80211itemd_t *item;
 	u32 *data;
+	unsigned int s3data_count = 0;
 
 	/* Initialize the data structures */
 	ns3data = 0;
-	memset(s3data, 0, sizeof(s3data));
+	for (s3data_count = 0; s3data_count < S3DATA_MAX; s3data_count++)
+		memset(&s3data[s3data_count], 0, sizeof(struct s3datarec));
 	ns3plug = 0;
 	memset(s3plug, 0, sizeof(s3plug));
 	ns3crc = 0;
@@ -466,8 +468,10 @@ static void free_chunks(struct imgchunk *fchunk, unsigned int *nfchunks)
 ----------------------------------------------------------------*/
 static void free_srecs(void)
 {
+	unsigned int s3data_count = 0;
 	ns3data = 0;
-	memset(s3data, 0, sizeof(s3data));
+	for (s3data_count = 0; s3data_count < S3DATA_MAX; s3data_count++)
+		memset(&s3data[s3data_count], 0, sizeof(struct s3datarec));
 	ns3plug = 0;
 	memset(s3plug, 0, sizeof(s3plug));
 	ns3crc = 0;
-- 
1.7.9.5

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