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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1465903877.30200.9.camel@au1.ibm.com>
Date:	Tue, 14 Jun 2016 21:31:17 +1000
From:	Benjamin Herrenschmidt <benh@....ibm.com>
To:	Shreyas B Prabhu <shreyas@...ux.vnet.ibm.com>, mpe@...erman.id.au
Cc:	ego@...ux.vnet.ibm.com, mikey@...ling.org,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	linux-pm@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	linux-kernel@...r.kernel.org, Rob Herring <robh+dt@...nel.org>,
	Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
	maddy@...ux.vnet.ibm.com
Subject: Re: [PATCH v6 10/11] cpuidle/powernv: Add support for POWER ISA v3
 idle states

	
 <1465404871-5406-11-git-send-email-shreyas@...ux.vnet.ibm.com>
	
	
 <1465854492.3022.30.camel@....ibm.com>
	 <575FE64C.9080107@...ux.vnet.ibm.com>
Organization: IBM Australia
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.20.3 (3.20.3-1.fc24) 
Mime-Version: 1.0
Content-Transfer-Encoding: 8bit

On Tue, 2016-06-14 at 16:41 +0530, Shreyas B Prabhu wrote:
> >> +            psscr_val = kcalloc(dt_idle_states, sizeof(*psscr_val),
> >> +                                GFP_KERNEL);
> >> +            rc = of_property_read_u64_array(power_mgt,
> >> +                                            "ibm,cpu-idle-state-psscr",
> >> +                                            psscr_val, dt_idle_states);
> > 
> > Here, psscr val is only one u64 ... shouldn't you kmalloc sizeof(..) *
> > dt_idle_states ?
> 
> I'm using kcalloc here since checkpatch script suggested kcalloc over
> kzalloc for allocating memory for arrays.
> I'll also include a patch to use kcalloc throughout the file for
> uniformity in next version. I was originally planning to post that
> cleanup separately.

Ah ok, I missed the use of kcalloc (I didn't even know its existence),
my brain just read kmalloc :-)

Still, I find it inconsistent that you allocate here while you use the
stack for the names. Any reason for that ?

Cheers,
Ben.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ