lkml.org 
[lkml]   [2013]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [ 12/40] hw_random: make buffer usable in scatterlist.
Date
Satoru Takeuchi <satoru.takeuchi@gmail.com> writes:
> Hi Rusty,
>
> At Tue, 12 Mar 2013 15:43:33 -0700,
> Greg Kroah-Hartman wrote:
>> @@ -307,6 +312,14 @@ int hwrng_register(struct hwrng *rng)
>>
>> mutex_lock(&rng_mutex);
>>
>> + /* kmalloc makes this safe for virt_to_page() in virtio_rng.c */
>> + err = -ENOMEM;
>> + if (!rng_buffer) {
>> + rng_buffer = kmalloc(rng_buffer_size(), GFP_KERNEL);
>
> rng_buffer is now kmalloc-ed, but not kfree-ed. Shoudn't it be kfree-ed
> at hwrng_unregister()? If my suspect is correct, the same problem is
> in 3.8.3-rc1 and 3.0.69-rc1. I'm OK to make a patch, but it'll be after
> some hours.
>
> Corecct me if I'm wrong.

Yes, it would be nice to free it, but it really makes sense to free it
in module_cleanup() (which would have to be written, as the module
currently doesn't have one).

Cheers,
Rusty.


\
 
 \ /
  Last update: 2013-03-14 08:21    [W:0.172 / U:0.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site