Re: [PATCH v2 2/2] mm: kvmalloc: align kvrealloc() with krealloc()

From: Andrew Morton
Date: Mon Jul 22 2024 - 21:44:02 EST


On Mon, 22 Jul 2024 18:29:24 +0200 Danilo Krummrich <dakr@xxxxxxxxxx> wrote:

> Besides the obvious (and desired) difference between krealloc() and
> kvrealloc(), there is some inconsistency in their function signatures
> and behavior:
>
> - krealloc() frees the memory when the requested size is zero, whereas
> kvrealloc() simply returns a pointer to the existing allocation.

The old kvrealloc() behavior actually sounds somewhat useful. You've
checked that no existing sites were relying on this?

And that all existing kvrealloc() callers were (incorrectly) checking
for NULL? Seems that way.