lkml.org 
[lkml]   [2019]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] trace: Avoid memory leak in predicate_parse()
From
Date
On 5/28/19 5:29 PM, Steven Rostedt wrote:
> On Tue, 28 May 2019 17:18:59 +0200
> Tomas Bortoli <tomasbortoli@gmail.com> wrote:
>
>>>> + memset(prog_stack, 0, nr_preds * sizeof(*prog_stack));
>>>> +
>>>
>>> Can you instead just switch the allocation of prog_stack to use
>>> kcalloc()?
>>
>> kmalloc_array() is safe against arithmetic overflow of the arguments.
>> Using kcalloc() directly we wouldn't check for that. Not really ideal in
>> my opinion. And there's no kcalloc_array() apparently!
>
> But doesn't kcalloc() simply call kmalloc_array() with the GFP_ZERO
> flag?
>

It does! Oops, I'll send it shortly

Tomas

\
 
 \ /
  Last update: 2019-05-28 17:33    [W:0.050 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site