lkml.org 
[lkml]   [2020]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4 4/4] KEYS: Avoid false positive ENOMEM error on key read
Date
Waiman Long <longman@redhat.com> wrote:

> +static inline void __kvzfree(const void *addr, size_t len)
> +{
> + if (addr) {
> + memset((void *)addr, 0, len);
> + kvfree(addr);
> + }
> +}

I wonder if that would be better as "kvfree(memset(...))" as memset() will
return the address parameter. If memset is not inline, it avoids the need for
the compiler to save the parameter.

David

\
 
 \ /
  Last update: 2020-03-18 09:28    [W:0.108 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site