Re: [PATCHv3 20/29] tools lib traceevent: Remove malloc_or_die from plugin_function.c

From: Namhyung Kim
Date: Fri Nov 29 2013 - 05:54:46 EST


> Removing malloc_or_die calls from plugin_function.c,
> replacing them and factoring the code with standard
> realloc and error path.

[SNIP]
>
> if (cpu > cpus) {
> - if (fstack)
> - fstack = realloc(fstack, sizeof(*fstack) * (cpu + 1));
> - else
> - fstack = malloc_or_die(sizeof(*fstack) * (cpu + 1));
> + fstack = realloc(fstack, sizeof(*fstack) * (cpu + 1));

This code also has same problem..

Thanks,
Namhyung


> + if (!fstack) {
> + warning("could not allocate plugin memory\n");
> + return 0;
> + }
>
> /* Account for holes in the cpu count */
> for (i = cpus + 1; i <= cpu; i++)
> --
> 1.8.3.1
>
--
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/