mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using
git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'
to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.
Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.
For the same reason the 'flex' versions will be done as a separate
conversion.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -671,7 +671,7 @@ static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q,
|
||||
return ERR_PTR(-EBUSY);
|
||||
}
|
||||
|
||||
bt = kzalloc_obj(*bt, GFP_KERNEL);
|
||||
bt = kzalloc_obj(*bt);
|
||||
if (!bt)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -1904,7 +1904,7 @@ static int blk_trace_setup_queue(struct request_queue *q,
|
||||
struct blk_trace *bt = NULL;
|
||||
int ret = -ENOMEM;
|
||||
|
||||
bt = kzalloc_obj(*bt, GFP_KERNEL);
|
||||
bt = kzalloc_obj(*bt);
|
||||
if (!bt)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -2243,7 +2243,7 @@ static int bpf_event_notify(struct notifier_block *nb, unsigned long op,
|
||||
|
||||
switch (op) {
|
||||
case MODULE_STATE_COMING:
|
||||
btm = kzalloc_obj(*btm, GFP_KERNEL);
|
||||
btm = kzalloc_obj(*btm);
|
||||
if (btm) {
|
||||
btm->module = module;
|
||||
list_add(&btm->list, &bpf_trace_modules);
|
||||
@@ -2819,7 +2819,7 @@ int bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr
|
||||
goto error;
|
||||
}
|
||||
|
||||
link = kzalloc_obj(*link, GFP_KERNEL);
|
||||
link = kzalloc_obj(*link);
|
||||
if (!link) {
|
||||
err = -ENOMEM;
|
||||
goto error;
|
||||
@@ -3238,8 +3238,8 @@ int bpf_uprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr
|
||||
|
||||
err = -ENOMEM;
|
||||
|
||||
link = kzalloc_obj(*link, GFP_KERNEL);
|
||||
uprobes = kvzalloc_objs(*uprobes, cnt, GFP_KERNEL);
|
||||
link = kzalloc_obj(*link);
|
||||
uprobes = kvzalloc_objs(*uprobes, cnt);
|
||||
|
||||
if (!uprobes || !link)
|
||||
goto error_free;
|
||||
|
||||
@@ -805,7 +805,7 @@ int register_fprobe(struct fprobe *fp, const char *filter, const char *notfilter
|
||||
if (!addrs)
|
||||
return -ENOMEM;
|
||||
|
||||
mods = kzalloc_objs(*mods, num, GFP_KERNEL);
|
||||
mods = kzalloc_objs(*mods, num);
|
||||
if (!mods)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -702,7 +702,7 @@ static int ftrace_profile_init_cpu(int cpu)
|
||||
*/
|
||||
size = FTRACE_PROFILE_HASH_SIZE;
|
||||
|
||||
stat->hash = kzalloc_objs(struct hlist_head, size, GFP_KERNEL);
|
||||
stat->hash = kzalloc_objs(struct hlist_head, size);
|
||||
|
||||
if (!stat->hash)
|
||||
return -ENOMEM;
|
||||
@@ -1215,7 +1215,7 @@ add_ftrace_hash_entry_direct(struct ftrace_hash *hash, unsigned long ip, unsigne
|
||||
{
|
||||
struct ftrace_func_entry *entry;
|
||||
|
||||
entry = kmalloc_obj(*entry, GFP_KERNEL);
|
||||
entry = kmalloc_obj(*entry);
|
||||
if (!entry)
|
||||
return NULL;
|
||||
|
||||
@@ -1335,12 +1335,12 @@ struct ftrace_hash *alloc_ftrace_hash(int size_bits)
|
||||
struct ftrace_hash *hash;
|
||||
int size;
|
||||
|
||||
hash = kzalloc_obj(*hash, GFP_KERNEL);
|
||||
hash = kzalloc_obj(*hash);
|
||||
if (!hash)
|
||||
return NULL;
|
||||
|
||||
size = 1 << size_bits;
|
||||
hash->buckets = kzalloc_objs(*hash->buckets, size, GFP_KERNEL);
|
||||
hash->buckets = kzalloc_objs(*hash->buckets, size);
|
||||
|
||||
if (!hash->buckets) {
|
||||
kfree(hash);
|
||||
@@ -1360,7 +1360,7 @@ static int ftrace_add_mod(struct trace_array *tr,
|
||||
struct ftrace_mod_load *ftrace_mod;
|
||||
struct list_head *mod_head = enable ? &tr->mod_trace : &tr->mod_notrace;
|
||||
|
||||
ftrace_mod = kzalloc_obj(*ftrace_mod, GFP_KERNEL);
|
||||
ftrace_mod = kzalloc_obj(*ftrace_mod);
|
||||
if (!ftrace_mod)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -3911,7 +3911,7 @@ ftrace_allocate_pages(unsigned long num_to_init, unsigned long *num_pages)
|
||||
if (!num_to_init)
|
||||
return NULL;
|
||||
|
||||
start_pg = pg = kzalloc_obj(*pg, GFP_KERNEL);
|
||||
start_pg = pg = kzalloc_obj(*pg);
|
||||
if (!pg)
|
||||
return NULL;
|
||||
|
||||
@@ -3929,7 +3929,7 @@ ftrace_allocate_pages(unsigned long num_to_init, unsigned long *num_pages)
|
||||
if (!num_to_init)
|
||||
break;
|
||||
|
||||
pg->next = kzalloc_obj(*pg, GFP_KERNEL);
|
||||
pg->next = kzalloc_obj(*pg);
|
||||
if (!pg->next)
|
||||
goto free_pages;
|
||||
|
||||
@@ -4686,7 +4686,7 @@ ftrace_regex_open(struct ftrace_ops *ops, int flag,
|
||||
if (tracing_check_open_get_tr(tr))
|
||||
return -ENODEV;
|
||||
|
||||
iter = kzalloc_obj(*iter, GFP_KERNEL);
|
||||
iter = kzalloc_obj(*iter);
|
||||
if (!iter)
|
||||
goto out;
|
||||
|
||||
@@ -5334,7 +5334,7 @@ int ftrace_func_mapper_add_ip(struct ftrace_func_mapper *mapper,
|
||||
if (entry)
|
||||
return -EBUSY;
|
||||
|
||||
map = kmalloc_obj(*map, GFP_KERNEL);
|
||||
map = kmalloc_obj(*map);
|
||||
if (!map)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -5474,7 +5474,7 @@ register_ftrace_function_probe(char *glob, struct trace_array *tr,
|
||||
}
|
||||
}
|
||||
if (!probe) {
|
||||
probe = kzalloc_obj(*probe, GFP_KERNEL);
|
||||
probe = kzalloc_obj(*probe);
|
||||
if (!probe) {
|
||||
mutex_unlock(&ftrace_lock);
|
||||
return -ENOMEM;
|
||||
@@ -7223,7 +7223,7 @@ ftrace_graph_open(struct inode *inode, struct file *file)
|
||||
if (unlikely(ftrace_disabled))
|
||||
return -ENODEV;
|
||||
|
||||
fgd = kmalloc_obj(*fgd, GFP_KERNEL);
|
||||
fgd = kmalloc_obj(*fgd);
|
||||
if (fgd == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -7251,7 +7251,7 @@ ftrace_graph_notrace_open(struct inode *inode, struct file *file)
|
||||
if (unlikely(ftrace_disabled))
|
||||
return -ENODEV;
|
||||
|
||||
fgd = kmalloc_obj(*fgd, GFP_KERNEL);
|
||||
fgd = kmalloc_obj(*fgd);
|
||||
if (fgd == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -8041,7 +8041,7 @@ static void save_ftrace_mod_rec(struct ftrace_mod_map *mod_map,
|
||||
if (!ret)
|
||||
return;
|
||||
|
||||
mod_func = kmalloc_obj(*mod_func, GFP_KERNEL);
|
||||
mod_func = kmalloc_obj(*mod_func);
|
||||
if (!mod_func)
|
||||
return;
|
||||
|
||||
@@ -8068,7 +8068,7 @@ allocate_ftrace_mod_map(struct module *mod,
|
||||
if (ftrace_disabled)
|
||||
return NULL;
|
||||
|
||||
mod_map = kmalloc_obj(*mod_map, GFP_KERNEL);
|
||||
mod_map = kmalloc_obj(*mod_map);
|
||||
if (!mod_map)
|
||||
return NULL;
|
||||
|
||||
@@ -8241,7 +8241,7 @@ static void add_to_clear_hash_list(struct list_head *clear_list,
|
||||
{
|
||||
struct ftrace_init_func *func;
|
||||
|
||||
func = kmalloc_obj(*func, GFP_KERNEL);
|
||||
func = kmalloc_obj(*func);
|
||||
if (!func) {
|
||||
MEM_FAIL(1, "alloc failure, ftrace filter could be stale\n");
|
||||
return;
|
||||
|
||||
@@ -423,7 +423,7 @@ struct trace_pid_list *trace_pid_list_alloc(void)
|
||||
/* According to linux/thread.h, pids can be no bigger that 30 bits */
|
||||
WARN_ON_ONCE(init_pid_ns.pid_max > (1 << 30));
|
||||
|
||||
pid_list = kzalloc_obj(*pid_list, GFP_KERNEL);
|
||||
pid_list = kzalloc_obj(*pid_list);
|
||||
if (!pid_list)
|
||||
return NULL;
|
||||
|
||||
@@ -435,7 +435,7 @@ struct trace_pid_list *trace_pid_list_alloc(void)
|
||||
for (i = 0; i < CHUNK_ALLOC; i++) {
|
||||
union upper_chunk *chunk;
|
||||
|
||||
chunk = kzalloc_obj(*chunk, GFP_KERNEL);
|
||||
chunk = kzalloc_obj(*chunk);
|
||||
if (!chunk)
|
||||
break;
|
||||
chunk->next = pid_list->upper_list;
|
||||
@@ -446,7 +446,7 @@ struct trace_pid_list *trace_pid_list_alloc(void)
|
||||
for (i = 0; i < CHUNK_ALLOC; i++) {
|
||||
union lower_chunk *chunk;
|
||||
|
||||
chunk = kzalloc_obj(*chunk, GFP_KERNEL);
|
||||
chunk = kzalloc_obj(*chunk);
|
||||
if (!chunk)
|
||||
break;
|
||||
chunk->next = pid_list->lower_list;
|
||||
|
||||
@@ -108,7 +108,7 @@ struct rethook *rethook_alloc(void *data, rethook_handler_t handler,
|
||||
if (!handler || num <= 0 || size < sizeof(struct rethook_node))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
rh = kzalloc_obj(struct rethook, GFP_KERNEL);
|
||||
rh = kzalloc_obj(struct rethook);
|
||||
if (!rh)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
||||
@@ -6509,7 +6509,7 @@ ring_buffer_alloc_read_page(struct trace_buffer *buffer, int cpu)
|
||||
if (!cpumask_test_cpu(cpu, buffer->cpumask))
|
||||
return ERR_PTR(-ENODEV);
|
||||
|
||||
bpage = kzalloc_obj(*bpage, GFP_KERNEL);
|
||||
bpage = kzalloc_obj(*bpage);
|
||||
if (!bpage)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -7190,7 +7190,7 @@ static int __rb_map_vma(struct ring_buffer_per_cpu *cpu_buffer,
|
||||
|
||||
nr_pages = nr_vma_pages;
|
||||
|
||||
pages = kzalloc_objs(*pages, nr_pages, GFP_KERNEL);
|
||||
pages = kzalloc_objs(*pages, nr_pages);
|
||||
if (!pages)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -1064,7 +1064,7 @@ int tracing_snapshot_cond_enable(struct trace_array *tr, void *cond_data,
|
||||
cond_update_fn_t update)
|
||||
{
|
||||
struct cond_snapshot *cond_snapshot __free(kfree) =
|
||||
kzalloc_obj(*cond_snapshot, GFP_KERNEL);
|
||||
kzalloc_obj(*cond_snapshot);
|
||||
int ret;
|
||||
|
||||
if (!cond_snapshot)
|
||||
@@ -5132,7 +5132,7 @@ trace_insert_eval_map_file(struct module *mod, struct trace_eval_map **start,
|
||||
* where the head holds the module and length of array, and the
|
||||
* tail holds a pointer to the next list.
|
||||
*/
|
||||
map_array = kmalloc_objs(*map_array, len + 2, GFP_KERNEL);
|
||||
map_array = kmalloc_objs(*map_array, len + 2);
|
||||
if (!map_array) {
|
||||
pr_warn("Unable to allocate trace eval mapping\n");
|
||||
return;
|
||||
@@ -5809,7 +5809,7 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp)
|
||||
goto fail_pipe_on_cpu;
|
||||
|
||||
/* create a buffer to store the information to pass to userspace */
|
||||
iter = kzalloc_obj(*iter, GFP_KERNEL);
|
||||
iter = kzalloc_obj(*iter);
|
||||
if (!iter) {
|
||||
ret = -ENOMEM;
|
||||
goto fail_alloc_iter;
|
||||
@@ -6628,7 +6628,7 @@ static int user_buffer_init(struct trace_user_buf_info **tinfo, size_t size)
|
||||
|
||||
if (!*tinfo) {
|
||||
alloc = true;
|
||||
*tinfo = kzalloc_obj(**tinfo, GFP_KERNEL);
|
||||
*tinfo = kzalloc_obj(**tinfo);
|
||||
if (!*tinfo)
|
||||
return -ENOMEM;
|
||||
}
|
||||
@@ -7153,10 +7153,10 @@ static int tracing_snapshot_open(struct inode *inode, struct file *file)
|
||||
} else {
|
||||
/* Writes still need the seq_file to hold the private data */
|
||||
ret = -ENOMEM;
|
||||
m = kzalloc_obj(*m, GFP_KERNEL);
|
||||
m = kzalloc_obj(*m);
|
||||
if (!m)
|
||||
goto out;
|
||||
iter = kzalloc_obj(*iter, GFP_KERNEL);
|
||||
iter = kzalloc_obj(*iter);
|
||||
if (!iter) {
|
||||
kfree(m);
|
||||
goto out;
|
||||
@@ -7545,7 +7545,7 @@ static struct tracing_log_err *alloc_tracing_log_err(int len)
|
||||
{
|
||||
struct tracing_log_err *err;
|
||||
|
||||
err = kzalloc_obj(*err, GFP_KERNEL);
|
||||
err = kzalloc_obj(*err);
|
||||
if (!err)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -7804,7 +7804,7 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
info = kvzalloc_obj(*info, GFP_KERNEL);
|
||||
info = kvzalloc_obj(*info);
|
||||
if (!info) {
|
||||
trace_array_put(tr);
|
||||
return -ENOMEM;
|
||||
@@ -8065,7 +8065,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
|
||||
struct page *page;
|
||||
int r;
|
||||
|
||||
ref = kzalloc_obj(*ref, GFP_KERNEL);
|
||||
ref = kzalloc_obj(*ref);
|
||||
if (!ref) {
|
||||
ret = -ENOMEM;
|
||||
break;
|
||||
@@ -8284,7 +8284,7 @@ tracing_stats_read(struct file *filp, char __user *ubuf,
|
||||
unsigned long long t;
|
||||
unsigned long usec_rem;
|
||||
|
||||
s = kmalloc_obj(*s, GFP_KERNEL);
|
||||
s = kmalloc_obj(*s);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -8878,7 +8878,7 @@ create_trace_option_files(struct trace_array *tr, struct tracer *tracer,
|
||||
for (cnt = 0; opts[cnt].name; cnt++)
|
||||
;
|
||||
|
||||
topts = kzalloc_objs(*topts, cnt + 1, GFP_KERNEL);
|
||||
topts = kzalloc_objs(*topts, cnt + 1);
|
||||
if (!topts)
|
||||
return 0;
|
||||
|
||||
@@ -8950,7 +8950,7 @@ static int add_tracer(struct trace_array *tr, struct tracer *tracer)
|
||||
if (!trace_ok_for_array(tracer, tr))
|
||||
return 0;
|
||||
|
||||
t = kmalloc_obj(*t, GFP_KERNEL);
|
||||
t = kmalloc_obj(*t);
|
||||
if (!t)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -8967,7 +8967,7 @@ static int add_tracer(struct trace_array *tr, struct tracer *tracer)
|
||||
* If the tracer defines default flags, it means the flags are
|
||||
* per trace instance.
|
||||
*/
|
||||
flags = kmalloc_obj(*flags, GFP_KERNEL);
|
||||
flags = kmalloc_obj(*flags);
|
||||
if (!flags)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -9538,7 +9538,7 @@ trace_array_create_systems(const char *name, const char *systems,
|
||||
int ret;
|
||||
|
||||
ret = -ENOMEM;
|
||||
tr = kzalloc_obj(*tr, GFP_KERNEL);
|
||||
tr = kzalloc_obj(*tr);
|
||||
if (!tr)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ const struct btf_member *btf_find_struct_member(struct btf *btf,
|
||||
const char *name;
|
||||
int i, top = 0;
|
||||
|
||||
anon_stack = kzalloc_objs(*anon_stack, BTF_ANON_STACK_MAX, GFP_KERNEL);
|
||||
anon_stack = kzalloc_objs(*anon_stack, BTF_ANON_STACK_MAX);
|
||||
if (!anon_stack)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
||||
@@ -529,8 +529,8 @@ new_eprobe_trigger(struct trace_eprobe *ep, struct trace_event_file *file)
|
||||
struct eprobe_data *edata;
|
||||
int ret;
|
||||
|
||||
edata = kzalloc_obj(*edata, GFP_KERNEL);
|
||||
trigger = kzalloc_obj(*trigger, GFP_KERNEL);
|
||||
edata = kzalloc_obj(*edata);
|
||||
trigger = kzalloc_obj(*trigger);
|
||||
if (!trigger || !edata) {
|
||||
ret = -ENOMEM;
|
||||
goto error;
|
||||
|
||||
@@ -976,7 +976,7 @@ static int cache_mod(struct trace_array *tr, const char *mod, int set,
|
||||
if (!set)
|
||||
return remove_cache_mod(tr, mod, match, system, event);
|
||||
|
||||
event_mod = kzalloc_obj(*event_mod, GFP_KERNEL);
|
||||
event_mod = kzalloc_obj(*event_mod);
|
||||
if (!event_mod)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1648,7 +1648,7 @@ static void *s_start(struct seq_file *m, loff_t *pos)
|
||||
struct set_event_iter *iter;
|
||||
loff_t l;
|
||||
|
||||
iter = kzalloc_obj(*iter, GFP_KERNEL);
|
||||
iter = kzalloc_obj(*iter);
|
||||
mutex_lock(&event_mutex);
|
||||
if (!iter)
|
||||
return NULL;
|
||||
@@ -2206,7 +2206,7 @@ event_filter_read(struct file *filp, char __user *ubuf, size_t cnt,
|
||||
if (*ppos)
|
||||
return 0;
|
||||
|
||||
s = kmalloc_obj(*s, GFP_KERNEL);
|
||||
s = kmalloc_obj(*s);
|
||||
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
@@ -2320,7 +2320,7 @@ static int system_tr_open(struct inode *inode, struct file *filp)
|
||||
int ret;
|
||||
|
||||
/* Make a temporary dir that has no system but points to tr */
|
||||
dir = kzalloc_obj(*dir, GFP_KERNEL);
|
||||
dir = kzalloc_obj(*dir);
|
||||
if (!dir)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -2366,7 +2366,7 @@ subsystem_filter_read(struct file *filp, char __user *ubuf, size_t cnt,
|
||||
if (*ppos)
|
||||
return 0;
|
||||
|
||||
s = kmalloc_obj(*s, GFP_KERNEL);
|
||||
s = kmalloc_obj(*s);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -2416,7 +2416,7 @@ show_header_page_file(struct file *filp, char __user *ubuf, size_t cnt, loff_t *
|
||||
if (*ppos)
|
||||
return 0;
|
||||
|
||||
s = kmalloc_obj(*s, GFP_KERNEL);
|
||||
s = kmalloc_obj(*s);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -2440,7 +2440,7 @@ show_header_event_file(struct file *filp, char __user *ubuf, size_t cnt, loff_t
|
||||
if (*ppos)
|
||||
return 0;
|
||||
|
||||
s = kmalloc_obj(*s, GFP_KERNEL);
|
||||
s = kmalloc_obj(*s);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -2881,7 +2881,7 @@ create_new_subsystem(const char *name)
|
||||
struct event_subsystem *system;
|
||||
|
||||
/* need to create new entry */
|
||||
system = kmalloc_obj(*system, GFP_KERNEL);
|
||||
system = kmalloc_obj(*system);
|
||||
if (!system)
|
||||
return NULL;
|
||||
|
||||
@@ -2892,7 +2892,7 @@ create_new_subsystem(const char *name)
|
||||
if (!system->name)
|
||||
goto out_free;
|
||||
|
||||
system->filter = kzalloc_obj(struct event_filter, GFP_KERNEL);
|
||||
system->filter = kzalloc_obj(struct event_filter);
|
||||
if (!system->filter)
|
||||
goto out_free;
|
||||
|
||||
@@ -2960,7 +2960,7 @@ event_subsystem_dir(struct trace_array *tr, const char *name,
|
||||
}
|
||||
}
|
||||
|
||||
dir = kmalloc_obj(*dir, GFP_KERNEL);
|
||||
dir = kmalloc_obj(*dir);
|
||||
if (!dir)
|
||||
goto out_fail;
|
||||
|
||||
@@ -3403,7 +3403,7 @@ static void add_str_to_module(struct module *module, char *str)
|
||||
{
|
||||
struct module_string *modstr;
|
||||
|
||||
modstr = kmalloc_obj(*modstr, GFP_KERNEL);
|
||||
modstr = kmalloc_obj(*modstr);
|
||||
|
||||
/*
|
||||
* If we failed to allocate memory here, then we'll just
|
||||
@@ -4365,7 +4365,7 @@ event_enable_func(struct trace_array *tr, struct ftrace_hash *hash,
|
||||
goto out_put;
|
||||
|
||||
ret = -ENOMEM;
|
||||
data = kzalloc_obj(*data, GFP_KERNEL);
|
||||
data = kzalloc_obj(*data);
|
||||
if (!data)
|
||||
goto out_put;
|
||||
|
||||
|
||||
@@ -485,10 +485,10 @@ predicate_parse(const char *str, int nr_parens, int nr_preds,
|
||||
|
||||
nr_preds += 2; /* For TRUE and FALSE */
|
||||
|
||||
op_stack = kmalloc_objs(*op_stack, nr_parens, GFP_KERNEL);
|
||||
op_stack = kmalloc_objs(*op_stack, nr_parens);
|
||||
if (!op_stack)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
prog_stack = kzalloc_objs(*prog_stack, nr_preds, GFP_KERNEL);
|
||||
prog_stack = kzalloc_objs(*prog_stack, nr_preds);
|
||||
if (!prog_stack) {
|
||||
parse_error(pe, -ENOMEM, 0);
|
||||
goto out_free;
|
||||
@@ -1213,7 +1213,7 @@ static void append_filter_err(struct trace_array *tr,
|
||||
if (WARN_ON(!filter->filter_string))
|
||||
return;
|
||||
|
||||
s = kmalloc_obj(*s, GFP_KERNEL);
|
||||
s = kmalloc_obj(*s);
|
||||
if (!s)
|
||||
return;
|
||||
trace_seq_init(s);
|
||||
@@ -1394,13 +1394,13 @@ static void try_delay_free_filter(struct event_filter *filter)
|
||||
struct filter_head *head;
|
||||
struct filter_list *item;
|
||||
|
||||
head = kmalloc_obj(*head, GFP_KERNEL);
|
||||
head = kmalloc_obj(*head);
|
||||
if (!head)
|
||||
goto free_now;
|
||||
|
||||
INIT_LIST_HEAD(&head->list);
|
||||
|
||||
item = kmalloc_obj(*item, GFP_KERNEL);
|
||||
item = kmalloc_obj(*item);
|
||||
if (!item) {
|
||||
kfree(head);
|
||||
goto free_now;
|
||||
@@ -1442,7 +1442,7 @@ static void filter_free_subsystem_filters(struct trace_subsystem_dir *dir,
|
||||
struct filter_head *head;
|
||||
struct filter_list *item;
|
||||
|
||||
head = kmalloc_obj(*head, GFP_KERNEL);
|
||||
head = kmalloc_obj(*head);
|
||||
if (!head)
|
||||
goto free_now;
|
||||
|
||||
@@ -1451,7 +1451,7 @@ static void filter_free_subsystem_filters(struct trace_subsystem_dir *dir,
|
||||
list_for_each_entry(file, &tr->events, list) {
|
||||
if (file->system != dir)
|
||||
continue;
|
||||
item = kmalloc_obj(*item, GFP_KERNEL);
|
||||
item = kmalloc_obj(*item);
|
||||
if (!item)
|
||||
goto free_now;
|
||||
item->filter = event_filter(file);
|
||||
@@ -1459,7 +1459,7 @@ static void filter_free_subsystem_filters(struct trace_subsystem_dir *dir,
|
||||
event_clear_filter(file);
|
||||
}
|
||||
|
||||
item = kmalloc_obj(*item, GFP_KERNEL);
|
||||
item = kmalloc_obj(*item);
|
||||
if (!item)
|
||||
goto free_now;
|
||||
|
||||
@@ -1708,7 +1708,7 @@ static int parse_pred(const char *str, void *data,
|
||||
|
||||
s = i;
|
||||
|
||||
pred = kzalloc_obj(*pred, GFP_KERNEL);
|
||||
pred = kzalloc_obj(*pred);
|
||||
if (!pred)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1819,7 +1819,7 @@ static int parse_pred(const char *str, void *data,
|
||||
goto err_free;
|
||||
}
|
||||
|
||||
pred->regex = kzalloc_obj(*pred->regex, GFP_KERNEL);
|
||||
pred->regex = kzalloc_obj(*pred->regex);
|
||||
if (!pred->regex)
|
||||
goto err_mem;
|
||||
pred->regex->len = len;
|
||||
@@ -1984,7 +1984,7 @@ static int parse_pred(const char *str, void *data,
|
||||
goto err_free;
|
||||
}
|
||||
|
||||
pred->regex = kzalloc_obj(*pred->regex, GFP_KERNEL);
|
||||
pred->regex = kzalloc_obj(*pred->regex);
|
||||
if (!pred->regex)
|
||||
goto err_mem;
|
||||
pred->regex->len = len;
|
||||
@@ -2261,7 +2261,7 @@ static int process_system_preds(struct trace_subsystem_dir *dir,
|
||||
bool fail = true;
|
||||
int err;
|
||||
|
||||
filter_list = kmalloc_obj(*filter_list, GFP_KERNEL);
|
||||
filter_list = kmalloc_obj(*filter_list);
|
||||
if (!filter_list)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -2272,7 +2272,7 @@ static int process_system_preds(struct trace_subsystem_dir *dir,
|
||||
if (file->system != dir)
|
||||
continue;
|
||||
|
||||
filter = kzalloc_obj(*filter, GFP_KERNEL);
|
||||
filter = kzalloc_obj(*filter);
|
||||
if (!filter)
|
||||
goto fail_mem;
|
||||
|
||||
@@ -2289,7 +2289,7 @@ static int process_system_preds(struct trace_subsystem_dir *dir,
|
||||
event_set_filtered_flag(file);
|
||||
|
||||
|
||||
filter_item = kzalloc_obj(*filter_item, GFP_KERNEL);
|
||||
filter_item = kzalloc_obj(*filter_item);
|
||||
if (!filter_item)
|
||||
goto fail_mem;
|
||||
|
||||
@@ -2343,14 +2343,14 @@ static int create_filter_start(char *filter_string, bool set_str,
|
||||
if (WARN_ON_ONCE(*pse || *filterp))
|
||||
return -EINVAL;
|
||||
|
||||
filter = kzalloc_obj(*filter, GFP_KERNEL);
|
||||
filter = kzalloc_obj(*filter);
|
||||
if (filter && set_str) {
|
||||
filter->filter_string = kstrdup(filter_string, GFP_KERNEL);
|
||||
if (!filter->filter_string)
|
||||
err = -ENOMEM;
|
||||
}
|
||||
|
||||
pe = kzalloc_obj(*pe, GFP_KERNEL);
|
||||
pe = kzalloc_obj(*pe);
|
||||
|
||||
if (!filter || !pe || err) {
|
||||
kfree(pe);
|
||||
|
||||
@@ -732,7 +732,7 @@ static struct track_data *track_data_alloc(unsigned int key_len,
|
||||
struct action_data *action_data,
|
||||
struct hist_trigger_data *hist_data)
|
||||
{
|
||||
struct track_data *data = kzalloc_obj(*data, GFP_KERNEL);
|
||||
struct track_data *data = kzalloc_obj(*data);
|
||||
struct hist_elt_data *elt_data;
|
||||
|
||||
if (!data)
|
||||
@@ -748,7 +748,7 @@ static struct track_data *track_data_alloc(unsigned int key_len,
|
||||
data->action_data = action_data;
|
||||
data->hist_data = hist_data;
|
||||
|
||||
elt_data = kzalloc_obj(*elt_data, GFP_KERNEL);
|
||||
elt_data = kzalloc_obj(*elt_data);
|
||||
if (!elt_data) {
|
||||
track_data_free(data);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
@@ -1086,7 +1086,7 @@ static int save_hist_vars(struct hist_trigger_data *hist_data)
|
||||
if (tracing_check_open_get_tr(tr))
|
||||
return -ENODEV;
|
||||
|
||||
var_data = kzalloc_obj(*var_data, GFP_KERNEL);
|
||||
var_data = kzalloc_obj(*var_data);
|
||||
if (!var_data) {
|
||||
trace_array_put(tr);
|
||||
return -ENOMEM;
|
||||
@@ -1548,7 +1548,7 @@ parse_hist_trigger_attrs(struct trace_array *tr, char *trigger_str)
|
||||
struct hist_trigger_attrs *attrs;
|
||||
int ret = 0;
|
||||
|
||||
attrs = kzalloc_obj(*attrs, GFP_KERNEL);
|
||||
attrs = kzalloc_obj(*attrs);
|
||||
if (!attrs)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -1646,7 +1646,7 @@ static int hist_trigger_elt_data_alloc(struct tracing_map_elt *elt)
|
||||
struct hist_field *hist_field;
|
||||
unsigned int i, n_str;
|
||||
|
||||
elt_data = kzalloc_obj(*elt_data, GFP_KERNEL);
|
||||
elt_data = kzalloc_obj(*elt_data);
|
||||
if (!elt_data)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1962,7 +1962,7 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data,
|
||||
if (field && is_function_field(field))
|
||||
return NULL;
|
||||
|
||||
hist_field = kzalloc_obj(struct hist_field, GFP_KERNEL);
|
||||
hist_field = kzalloc_obj(struct hist_field);
|
||||
if (!hist_field)
|
||||
return NULL;
|
||||
|
||||
@@ -3049,7 +3049,7 @@ create_field_var_hist(struct hist_trigger_data *target_hist_data,
|
||||
if (!IS_ERR_OR_NULL(event_var))
|
||||
return event_var;
|
||||
|
||||
var_hist = kzalloc_obj(*var_hist, GFP_KERNEL);
|
||||
var_hist = kzalloc_obj(*var_hist);
|
||||
if (!var_hist)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -3231,7 +3231,7 @@ static struct hist_field *create_var(struct hist_trigger_data *hist_data,
|
||||
goto out;
|
||||
}
|
||||
|
||||
var = kzalloc_obj(struct hist_field, GFP_KERNEL);
|
||||
var = kzalloc_obj(struct hist_field);
|
||||
if (!var) {
|
||||
var = ERR_PTR(-ENOMEM);
|
||||
goto out;
|
||||
@@ -3292,7 +3292,7 @@ static struct field_var *create_field_var(struct hist_trigger_data *hist_data,
|
||||
goto err;
|
||||
}
|
||||
|
||||
field_var = kzalloc_obj(struct field_var, GFP_KERNEL);
|
||||
field_var = kzalloc_obj(struct field_var);
|
||||
if (!field_var) {
|
||||
destroy_hist_field(val, 0);
|
||||
kfree_const(var->type);
|
||||
@@ -3831,7 +3831,7 @@ static struct action_data *track_data_parse(struct hist_trigger_data *hist_data,
|
||||
int ret = -EINVAL;
|
||||
char *var_str;
|
||||
|
||||
data = kzalloc_obj(*data, GFP_KERNEL);
|
||||
data = kzalloc_obj(*data);
|
||||
if (!data)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -4198,7 +4198,7 @@ static struct action_data *onmatch_parse(struct trace_array *tr, char *str)
|
||||
struct action_data *data;
|
||||
int ret = -EINVAL;
|
||||
|
||||
data = kzalloc_obj(*data, GFP_KERNEL);
|
||||
data = kzalloc_obj(*data);
|
||||
if (!data)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -5136,7 +5136,7 @@ create_hist_data(unsigned int map_bits,
|
||||
struct hist_trigger_data *hist_data;
|
||||
int ret = 0;
|
||||
|
||||
hist_data = kzalloc_obj(*hist_data, GFP_KERNEL);
|
||||
hist_data = kzalloc_obj(*hist_data);
|
||||
if (!hist_data)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -5828,7 +5828,7 @@ static int event_hist_open(struct inode *inode, struct file *file)
|
||||
goto err;
|
||||
}
|
||||
|
||||
hist_file = kzalloc_obj(*hist_file, GFP_KERNEL);
|
||||
hist_file = kzalloc_obj(*hist_file);
|
||||
if (!hist_file) {
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
@@ -6602,7 +6602,7 @@ static int hist_register_trigger(char *glob,
|
||||
data->private_data = named_data->private_data;
|
||||
set_named_trigger_data(data, named_data);
|
||||
/* Copy the command ops and update some of the functions */
|
||||
cmd_ops = kmalloc_obj(*cmd_ops, GFP_KERNEL);
|
||||
cmd_ops = kmalloc_obj(*cmd_ops);
|
||||
if (!cmd_ops) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
|
||||
@@ -711,7 +711,7 @@ static struct synth_field *parse_synth_field(int argc, char **argv,
|
||||
|
||||
*field_version = check_field_version(prefix, field_type, field_name);
|
||||
|
||||
field = kzalloc_obj(*field, GFP_KERNEL);
|
||||
field = kzalloc_obj(*field);
|
||||
if (!field)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -819,7 +819,7 @@ static struct tracepoint *alloc_synth_tracepoint(char *name)
|
||||
{
|
||||
struct tracepoint *tp;
|
||||
|
||||
tp = kzalloc_obj(*tp, GFP_KERNEL);
|
||||
tp = kzalloc_obj(*tp);
|
||||
if (!tp)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -973,7 +973,7 @@ static struct synth_event *alloc_synth_event(const char *name, int n_fields,
|
||||
unsigned int i, j, n_dynamic_fields = 0;
|
||||
struct synth_event *event;
|
||||
|
||||
event = kzalloc_obj(*event, GFP_KERNEL);
|
||||
event = kzalloc_obj(*event);
|
||||
if (!event) {
|
||||
event = ERR_PTR(-ENOMEM);
|
||||
goto out;
|
||||
@@ -986,7 +986,7 @@ static struct synth_event *alloc_synth_event(const char *name, int n_fields,
|
||||
goto out;
|
||||
}
|
||||
|
||||
event->fields = kzalloc_objs(*event->fields, n_fields, GFP_KERNEL);
|
||||
event->fields = kzalloc_objs(*event->fields, n_fields);
|
||||
if (!event->fields) {
|
||||
free_synth_event(event);
|
||||
event = ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -914,7 +914,7 @@ struct event_trigger_data *trigger_data_alloc(struct event_command *cmd_ops,
|
||||
{
|
||||
struct event_trigger_data *trigger_data;
|
||||
|
||||
trigger_data = kzalloc_obj(*trigger_data, GFP_KERNEL);
|
||||
trigger_data = kzalloc_obj(*trigger_data);
|
||||
if (!trigger_data)
|
||||
return NULL;
|
||||
|
||||
@@ -1724,7 +1724,7 @@ int event_enable_trigger_parse(struct event_command *cmd_ops,
|
||||
#endif
|
||||
ret = -ENOMEM;
|
||||
|
||||
enable_data = kzalloc_obj(*enable_data, GFP_KERNEL);
|
||||
enable_data = kzalloc_obj(*enable_data);
|
||||
if (!enable_data)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -370,7 +370,7 @@ static struct user_event_group *user_event_group_create(void)
|
||||
{
|
||||
struct user_event_group *group;
|
||||
|
||||
group = kzalloc_obj(*group, GFP_KERNEL);
|
||||
group = kzalloc_obj(*group);
|
||||
|
||||
if (!group)
|
||||
return NULL;
|
||||
|
||||
@@ -99,7 +99,7 @@ static struct tracepoint_user *__tracepoint_user_init(const char *name, struct t
|
||||
struct tracepoint_user *tuser __free(tuser_free) = NULL;
|
||||
int ret;
|
||||
|
||||
tuser = kzalloc_obj(*tuser, GFP_KERNEL);
|
||||
tuser = kzalloc_obj(*tuser);
|
||||
if (!tuser)
|
||||
return NULL;
|
||||
tuser->name = kstrdup(name, GFP_KERNEL);
|
||||
@@ -1403,7 +1403,7 @@ static int trace_fprobe_create_cb(int argc, const char *argv[])
|
||||
struct traceprobe_parse_context *ctx __free(traceprobe_parse_context) = NULL;
|
||||
int ret;
|
||||
|
||||
ctx = kzalloc_obj(*ctx, GFP_KERNEL);
|
||||
ctx = kzalloc_obj(*ctx);
|
||||
if (!ctx)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ int ftrace_allocate_ftrace_ops(struct trace_array *tr)
|
||||
if (tr->flags & TRACE_ARRAY_FL_GLOBAL)
|
||||
return 0;
|
||||
|
||||
ops = kzalloc_obj(*ops, GFP_KERNEL);
|
||||
ops = kzalloc_obj(*ops);
|
||||
if (!ops)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -434,7 +434,7 @@ int allocate_fgraph_ops(struct trace_array *tr, struct ftrace_ops *ops)
|
||||
{
|
||||
struct fgraph_ops *gops;
|
||||
|
||||
gops = kzalloc_obj(*gops, GFP_KERNEL);
|
||||
gops = kzalloc_obj(*gops);
|
||||
if (!gops)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -1082,7 +1082,7 @@ static int trace_kprobe_create_cb(int argc, const char *argv[])
|
||||
struct traceprobe_parse_context *ctx __free(traceprobe_parse_context) = NULL;
|
||||
int ret;
|
||||
|
||||
ctx = kzalloc_obj(*ctx, GFP_KERNEL);
|
||||
ctx = kzalloc_obj(*ctx);
|
||||
if (!ctx)
|
||||
return -ENOMEM;
|
||||
ctx->flags = TPARG_FL_KERNEL;
|
||||
|
||||
@@ -101,7 +101,7 @@ static void mmio_pipe_open(struct trace_iterator *iter)
|
||||
|
||||
trace_seq_puts(s, "VERSION 20070824\n");
|
||||
|
||||
hiter = kzalloc_obj(*hiter, GFP_KERNEL);
|
||||
hiter = kzalloc_obj(*hiter);
|
||||
if (!hiter)
|
||||
return;
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ static int osnoise_register_instance(struct trace_array *tr)
|
||||
*/
|
||||
lockdep_assert_held(&trace_types_lock);
|
||||
|
||||
inst = kmalloc_obj(*inst, GFP_KERNEL);
|
||||
inst = kmalloc_obj(*inst);
|
||||
if (!inst)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ void hold_module_trace_bprintk_format(const char **start, const char **end)
|
||||
}
|
||||
|
||||
fmt = NULL;
|
||||
tb_fmt = kmalloc_obj(*tb_fmt, GFP_KERNEL);
|
||||
tb_fmt = kmalloc_obj(*tb_fmt);
|
||||
if (tb_fmt) {
|
||||
fmt = kmalloc(strlen(*iter) + 1, GFP_KERNEL);
|
||||
if (fmt) {
|
||||
|
||||
@@ -838,7 +838,7 @@ static int __store_entry_arg(struct trace_probe *tp, int argnum)
|
||||
int i, offset, last_offset = 0;
|
||||
|
||||
if (!earg) {
|
||||
earg = kzalloc_obj(*tp->entry_arg, GFP_KERNEL);
|
||||
earg = kzalloc_obj(*tp->entry_arg);
|
||||
if (!earg)
|
||||
return -ENOMEM;
|
||||
earg->size = 2 * tp->nr_args + 1;
|
||||
@@ -1499,7 +1499,7 @@ static int traceprobe_parse_probe_arg_body(const char *argv, ssize_t *size,
|
||||
if (IS_ERR(type))
|
||||
return PTR_ERR(type);
|
||||
|
||||
code = tmp = kzalloc_objs(*code, FETCH_INSN_MAX, GFP_KERNEL);
|
||||
code = tmp = kzalloc_objs(*code, FETCH_INSN_MAX);
|
||||
if (!code)
|
||||
return -ENOMEM;
|
||||
code[FETCH_INSN_MAX - 1].op = FETCH_OP_END;
|
||||
@@ -1543,7 +1543,7 @@ static int traceprobe_parse_probe_arg_body(const char *argv, ssize_t *size,
|
||||
if (code->op == FETCH_OP_END)
|
||||
break;
|
||||
/* Shrink down the code buffer */
|
||||
parg->code = kzalloc_objs(*code, code - tmp + 1, GFP_KERNEL);
|
||||
parg->code = kzalloc_objs(*code, code - tmp + 1);
|
||||
if (!parg->code)
|
||||
ret = -ENOMEM;
|
||||
else
|
||||
@@ -2149,7 +2149,7 @@ int trace_probe_add_file(struct trace_probe *tp, struct trace_event_file *file)
|
||||
{
|
||||
struct event_file_link *link;
|
||||
|
||||
link = kmalloc_obj(*link, GFP_KERNEL);
|
||||
link = kmalloc_obj(*link);
|
||||
if (!link)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ static void *recursed_function_seq_start(struct seq_file *m, loff_t *pos)
|
||||
ret = &recursed_functions[*pos];
|
||||
}
|
||||
|
||||
tseq = kzalloc_obj(*tseq, GFP_KERNEL);
|
||||
tseq = kzalloc_obj(*tseq);
|
||||
if (!tseq)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
||||
@@ -444,7 +444,7 @@ int trace_alloc_tgid_map(void)
|
||||
return 0;
|
||||
|
||||
tgid_map_max = init_pid_ns.pid_max;
|
||||
map = kvzalloc_objs(*tgid_map, tgid_map_max + 1, GFP_KERNEL);
|
||||
map = kvzalloc_objs(*tgid_map, tgid_map_max + 1);
|
||||
if (!map)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ static int trace_selftest_ops(struct trace_array *tr, int cnt)
|
||||
goto out;
|
||||
|
||||
/* Add a dynamic probe */
|
||||
dyn_ops = kzalloc_obj(*dyn_ops, GFP_KERNEL);
|
||||
dyn_ops = kzalloc_obj(*dyn_ops);
|
||||
if (!dyn_ops) {
|
||||
printk("MEMORY ERROR ");
|
||||
goto out;
|
||||
|
||||
@@ -77,7 +77,7 @@ static int insert_stat(struct rb_root *root, void *stat, cmp_func_t cmp)
|
||||
struct rb_node **new = &(root->rb_node), *parent = NULL;
|
||||
struct stat_node *data;
|
||||
|
||||
data = kzalloc_obj(*data, GFP_KERNEL);
|
||||
data = kzalloc_obj(*data);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
data->stat = stat;
|
||||
@@ -322,7 +322,7 @@ int register_stat_tracer(struct tracer_stat *trace)
|
||||
}
|
||||
|
||||
/* Init the session */
|
||||
session = kzalloc_obj(*session, GFP_KERNEL);
|
||||
session = kzalloc_obj(*session);
|
||||
if (!session)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -617,7 +617,7 @@ static int syscall_fault_buffer_enable(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
sbuf = kmalloc_obj(*sbuf, GFP_KERNEL);
|
||||
sbuf = kmalloc_obj(*sbuf);
|
||||
if (!sbuf)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -699,7 +699,7 @@ static int __trace_uprobe_create(int argc, const char **argv)
|
||||
memset(&path, 0, sizeof(path));
|
||||
tu->filename = no_free_ptr(filename);
|
||||
|
||||
ctx = kzalloc_obj(*ctx, GFP_KERNEL);
|
||||
ctx = kzalloc_obj(*ctx);
|
||||
if (!ctx)
|
||||
return -ENOMEM;
|
||||
ctx->flags = (is_return ? TPARG_FL_RETURN : 0) | TPARG_FL_USER;
|
||||
|
||||
@@ -324,7 +324,7 @@ static struct tracing_map_array *tracing_map_array_alloc(unsigned int n_elts,
|
||||
struct tracing_map_array *a;
|
||||
unsigned int i;
|
||||
|
||||
a = kzalloc_obj(*a, GFP_KERNEL);
|
||||
a = kzalloc_obj(*a);
|
||||
if (!a)
|
||||
return NULL;
|
||||
|
||||
@@ -405,7 +405,7 @@ static struct tracing_map_elt *tracing_map_elt_alloc(struct tracing_map *map)
|
||||
struct tracing_map_elt *elt;
|
||||
int err = 0;
|
||||
|
||||
elt = kzalloc_obj(*elt, GFP_KERNEL);
|
||||
elt = kzalloc_obj(*elt);
|
||||
if (!elt)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -417,19 +417,19 @@ static struct tracing_map_elt *tracing_map_elt_alloc(struct tracing_map *map)
|
||||
goto free;
|
||||
}
|
||||
|
||||
elt->fields = kzalloc_objs(*elt->fields, map->n_fields, GFP_KERNEL);
|
||||
elt->fields = kzalloc_objs(*elt->fields, map->n_fields);
|
||||
if (!elt->fields) {
|
||||
err = -ENOMEM;
|
||||
goto free;
|
||||
}
|
||||
|
||||
elt->vars = kzalloc_objs(*elt->vars, map->n_vars, GFP_KERNEL);
|
||||
elt->vars = kzalloc_objs(*elt->vars, map->n_vars);
|
||||
if (!elt->vars) {
|
||||
err = -ENOMEM;
|
||||
goto free;
|
||||
}
|
||||
|
||||
elt->var_set = kzalloc_objs(*elt->var_set, map->n_vars, GFP_KERNEL);
|
||||
elt->var_set = kzalloc_objs(*elt->var_set, map->n_vars);
|
||||
if (!elt->var_set) {
|
||||
err = -ENOMEM;
|
||||
goto free;
|
||||
@@ -777,7 +777,7 @@ struct tracing_map *tracing_map_create(unsigned int map_bits,
|
||||
map_bits > TRACING_MAP_BITS_MAX)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
map = kzalloc_obj(*map, GFP_KERNEL);
|
||||
map = kzalloc_obj(*map);
|
||||
if (!map)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -949,7 +949,7 @@ create_sort_entry(void *key, struct tracing_map_elt *elt)
|
||||
{
|
||||
struct tracing_map_sort_entry *sort_entry;
|
||||
|
||||
sort_entry = kzalloc_obj(*sort_entry, GFP_KERNEL);
|
||||
sort_entry = kzalloc_obj(*sort_entry);
|
||||
if (!sort_entry)
|
||||
return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user