Re: [PATCH] mm: Add kvfree_sensitive() for freeing sensitive data objects

From: David Howells
Date: Mon Apr 06 2020 - 03:44:27 EST


David Rientjes <rientjes@xxxxxxxxxx> wrote:

> > +static inline void kvfree_sensitive(const void *addr, size_t len)
> > +{
> > + if (addr) {
>
> Shouldn't this be if (unlikely(ZERO_OR_NULL_PTR(addr))?

You've reversed the logic - it needs a '!' there.

David