[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3E5A0FA7E9CA944F9D5414FEC6C712205DFD4DEE@ORSMSX106.amr.corp.intel.com>
Date: Thu, 14 Jul 2016 06:16:15 +0000
From: "Yu, Fenghua" <fenghua.yu@...el.com>
To: Thomas Gleixner <tglx@...utronix.de>,
David Carrillo-Cisneros <davidcc@...gle.com>
CC: Ingo Molnar <mingo@...e.hu>,
"Anvin, H Peter" <h.peter.anvin@...el.com>,
"Luck, Tony" <tony.luck@...el.com>, Tejun Heo <tj@...nel.org>,
"Borislav Petkov" <bp@...e.de>,
Stephane Eranian <eranian@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Marcelo Tosatti <mtosatti@...hat.com>,
"Shankar, Ravi V" <ravi.v.shankar@...el.com>,
Vikas Shivappa <vikas.shivappa@...ux.intel.com>,
"Prakhya, Sai Praneeth" <sai.praneeth.prakhya@...el.com>,
linux-kernel <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>
Subject: RE: [PATCH 30/32] x86/intel_rdt_rdtgroup.c: Process schemas input
from rscctrl interface
> From: Thomas Gleixner [mailto:tglx@...utronix.de]
> Sent: Wednesday, July 13, 2016 11:11 PM
> On Wed, 13 Jul 2016, David Carrillo-Cisneros wrote:
> > > +static void free_cache_resource(struct cache_resource *l) {
> > > + kfree(l->cbm);
> > > + kfree(l->cbm2);
> > > + kfree(l->closid);
> > > + kfree(l->refcnt);
> >
> > this function is used to clean up alloc_cache_resource in the error
> > path of get_resources where it's not necessarily true that all of l's
> > members were allocated.
>
> kfree handles kfree(NULL) nicely.....
Yes, that's right. If I check the pointer before kfree(), checkpatch.pl will
report warning for that and suggest kfree(NULL) is safe and code is
short.
Thanks.
-Fenghua
Powered by blists - more mailing lists