Given that the filter bytecode can reach 64kB, use vmalloc rather than
kmalloc to minimize the chances of failure on systems with fragmented
memory.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ret = get_user(bytecode_len, &bytecode->len);
if (ret)
return ret;
- bytecode_node = kzalloc(sizeof(*bytecode_node) + bytecode_len,
+ bytecode_node = lttng_kvzalloc(sizeof(*bytecode_node) + bytecode_len,
GFP_KERNEL);
if (!bytecode_node)
return -ENOMEM;
return 0;
error_free:
- kfree(bytecode_node);
+ lttng_kvfree(bytecode_node);
return ret;
}
/* Destroy filter bytecode */
list_for_each_entry_safe(filter_node, tmp_filter_node,
&enabler->filter_bytecode_head, node) {
- kfree(filter_node);
+ lttng_kvfree(filter_node);
}
}