Re: [PATCH v5 02/14] perf tools: Prevent calling machine__delete() on non-allocated machine
From: Jiri Olsa
Date: Tue Dec 15 2015 - 07:37:11 EST
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/