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-prev] [day] [month] [year] [list]
Date:	Thu, 18 Jun 2015 17:24:03 -0700
From:	Joe Perches <joe@...ches.com>
To:	Greg KH <gregkh@...uxfoundation.org>
Cc:	Bilel DRIRA <bilel.dr@...il.com>, eng.douglasfigueiredo@...il.com,
	matt@...ezulu.com, josh@...htriplett.org, raghav3276@...il.com,
	tapaswenipathak@...il.com, artemiyv@....org,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: wlan-ng: Fix memset warning found by sparse

On Thu, 2015-06-18 at 16:04 -0700, Greg KH wrote:
> On Thu, Jun 18, 2015 at 06:49:51PM +0100, Bilel DRIRA wrote:
> > This patch fixes the following sparse warnings:
[]
> > diff --git 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,
[]
> > -	memset(s3data, 0, sizeof(s3data));
> > +	for (s3data_count = 0; s3data_count < S3DATA_MAX; s3data_count++)
> > +		memset(&s3data[s3data_count], 0, sizeof(struct s3datarec));
> 
> You are doing the exact same thing here that the original code did, so
> why change it?
> 
> That sparse warning is just a hint, I don't see anything wrong here with
> the original code, sorry.

Greg's right.

A possible improvement would be to malloc/free memory
as necessary instead of using large static buffers.


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