Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758233AbcCVCqc (ORCPT ); Mon, 21 Mar 2016 22:46:32 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:35546 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752940AbcCVCqb (ORCPT ); Mon, 21 Mar 2016 22:46:31 -0400 Date: Tue, 22 Mar 2016 08:16:27 +0530 From: Viresh Kumar To: Shilpasri G Bhat Cc: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, ego@linux.vnet.ibm.com, linux-pm@vger.kernel.org, rjw@rjwysocki.net, shreyas@linux.vnet.ibm.com, linux-api@vger.kernel.org Subject: Re: [PATCH v11] cpufreq: powernv: Add sysfs attributes to show throttle stats Message-ID: <20160322024627.GP27778@vireshk-i7> References: <1458579591-27573-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458579591-27573-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 592 Lines: 24 On 21-03-16, 22:29, Shilpasri G Bhat wrote: > + create_throttle_sysfs = kcalloc(cpu_nr_cores(), sizeof(bool), > + GFP_KERNEL); > + if (!create_throttle_sysfs) { > + kfree(chips); > + return -ENOMEM; > + } > + > for (i = 0; i < nr_chips; i++) { > chips[i].id = chip[i]; > cpumask_copy(&chips[i].mask, cpumask_of_node(chip[i])); > @@ -582,6 +655,7 @@ static int init_chip_info(void) > > static inline void clean_chip_info(void) > { > + kfree(create_throttle_sysfs); > kfree(chips); > } Why do you need this at all?. You can use policy->driver data, isn't it ? -- viresh