From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chao Peng Subject: Re: [PATCH 2/6] x86: add support for COS/CBM manangement Date: Tue, 17 Mar 2015 16:57:37 +0800 Message-ID: <20150317085737.GC5371@pengc-linux.bj.intel.com> References: <1426241605-4114-1-git-send-email-chao.p.peng@linux.intel.com> <1426241605-4114-3-git-send-email-chao.p.peng@linux.intel.com> <20150313135337.GF5378@l.oracle.com> Reply-To: Chao Peng Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20150313135337.GF5378@l.oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: keir@xen.org, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, will.auld@intel.com, JBeulich@suse.com, wei.liu2@citrix.com, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org On Fri, Mar 13, 2015 at 09:53:37AM -0400, Konrad Rzeszutek Wilk wrote: > > + xfree(d->arch.psr_cos_ids); > > And d->arch.psr_cos_ids = NULL > > (however this depends on who calls psr_domain_init, which > is unclear to me). > > > +} > > + > > +int psr_domain_init(struct domain *d) > > +{ > > + if ( cat_socket_info ) > > + { > > + d->arch.psr_cos_ids = xzalloc_array(unsigned int, opt_socket_num); > > + if ( !d->arch.psr_cos_ids ) > > + return -ENOMEM; > > + } > > + > > + return 0; > > +} > > + > > +void psr_domain_free(struct domain *d) > > So who calls this? This function is called by arch_domain_destroy() or the failure path of arch_domain_create(). In both cases the domain structure will be freed later so setting NULL is pointless. Thanks, Chao > > > +{ > > + psr_free_rmid(d); > > + psr_free_cos(d); > > +} > > +