}
}
/*
- * Using malloc here to allocate a variable length element. Could
+ * Using zmalloc here to allocate a variable length element. Could
* cause some memory fragmentation if overused.
*/
- e = malloc(sizeof(struct marker_entry)
+ e = zmalloc(sizeof(struct marker_entry)
+ channel_len + name_len + format_len);
if (!e)
return ERR_PTR(-ENOMEM);
e->name = &e->channel[channel_len];
memcpy(e->name, name, name_len);
if (format) {
- e->format = &e->name[channel_len + name_len];
+ e->format = &e->name[name_len];
memcpy(e->format, format, format_len);
if (strcmp(e->format, MARK_NOARGS) == 0)
e->call = marker_probe_cb_noarg;
{
struct lib *pl;
- pl = (struct lib *) malloc(sizeof(struct lib));
+ pl = (struct lib *) zmalloc(sizeof(struct lib));
pl->markers_start = markers_start;
pl->markers_count = markers_count;