lkml.org 
[lkml]   [2015]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v5 02/14] perf tools: Prevent calling machine__delete() on non-allocated machine
On Mon, Dec 14, 2015 at 10:39:11AM +0000, Wang Nan wrote:

SNIP

> @@ -137,12 +138,15 @@ void machine__exit(struct machine *machine)
> void machine__delete(struct machine *machine)
> {
> machine__exit(machine);
> - free(machine);
> + if (machine->allocated)
> + free(machine);
> + else
> + pr_warning("WARNING: delete a non-allocated machine. Skip.\n");

we used WARN_ONCE several times already in similar cases

jirka


\
 
 \ /
  Last update: 2015-12-15 14:01    [W:0.138 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site