if (!field)
goto err;
- field->name = kstrdup(name, GFP_KERNEL);
- if (!field->name)
- goto err;
-
- field->type = kstrdup(type, GFP_KERNEL);
- if (!field->type)
- goto err;
+ field->name = name;
+ field->type = type;
if (filter_type == FILTER_OTHER)
field->filter_type = filter_assign_type(type);
return 0;
err:
- if (field)
- kfree(field->name);
kmem_cache_free(field_cachep, field);
return -ENOMEM;
head = trace_get_fields(call);
list_for_each_entry_safe(field, next, head, link) {
list_del(&field->link);
- kfree(field->type);
- kfree(field->name);
kmem_cache_free(field_cachep, field);
}
}
kfree(filter->filter_string);
kfree(filter);
}
- kfree(system->name);
kfree(system);
}
return NULL;
system->ref_count = 1;
- system->name = kstrdup(name, GFP_KERNEL);
-
- if (!system->name)
- goto out_free;
+ system->name = name;
system->filter = NULL;
return system;
out_free:
- kfree(system->name);
kfree(system);
return NULL;
}