diff options
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 108ce3e1dc13..8ea855015613 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1751,12 +1751,13 @@ static inline void set_cmdline(int idx, const char *cmdline) | |||
1751 | static int allocate_cmdlines_buffer(unsigned int val, | 1751 | static int allocate_cmdlines_buffer(unsigned int val, |
1752 | struct saved_cmdlines_buffer *s) | 1752 | struct saved_cmdlines_buffer *s) |
1753 | { | 1753 | { |
1754 | s->map_cmdline_to_pid = kmalloc(val * sizeof(*s->map_cmdline_to_pid), | 1754 | s->map_cmdline_to_pid = kmalloc_array(val, |
1755 | GFP_KERNEL); | 1755 | sizeof(*s->map_cmdline_to_pid), |
1756 | GFP_KERNEL); | ||
1756 | if (!s->map_cmdline_to_pid) | 1757 | if (!s->map_cmdline_to_pid) |
1757 | return -ENOMEM; | 1758 | return -ENOMEM; |
1758 | 1759 | ||
1759 | s->saved_cmdlines = kmalloc(val * TASK_COMM_LEN, GFP_KERNEL); | 1760 | s->saved_cmdlines = kmalloc_array(TASK_COMM_LEN, val, GFP_KERNEL); |
1760 | if (!s->saved_cmdlines) { | 1761 | if (!s->saved_cmdlines) { |
1761 | kfree(s->map_cmdline_to_pid); | 1762 | kfree(s->map_cmdline_to_pid); |
1762 | return -ENOMEM; | 1763 | return -ENOMEM; |
@@ -5063,7 +5064,7 @@ trace_insert_eval_map_file(struct module *mod, struct trace_eval_map **start, | |||
5063 | * where the head holds the module and length of array, and the | 5064 | * where the head holds the module and length of array, and the |
5064 | * tail holds a pointer to the next list. | 5065 | * tail holds a pointer to the next list. |
5065 | */ | 5066 | */ |
5066 | map_array = kmalloc(sizeof(*map_array) * (len + 2), GFP_KERNEL); | 5067 | map_array = kmalloc_array(len + 2, sizeof(*map_array), GFP_KERNEL); |
5067 | if (!map_array) { | 5068 | if (!map_array) { |
5068 | pr_warn("Unable to allocate trace eval mapping\n"); | 5069 | pr_warn("Unable to allocate trace eval mapping\n"); |
5069 | return; | 5070 | return; |