Document that concurrent calls to vrealloc() with itself or vfree() for
the same memory allocation are not permitted, since it leads to undefined
behavior.
Consequently, the same applies for kvrealloc(), hence also document it
for kvrealloc().
Link: https://lkml.kernel.org/r/20240725125442.4957-1-dakr@kernel.org
Suggested-by: Christoph Hellwig <hch@infradead.org>
Suggested-by: Uladzislau Rezki <urezki@gmail.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
* If @p is %NULL, kvrealloc() behaves exactly like kvmalloc(). If @size is 0
* and @p is not a %NULL pointer, the object pointed to is freed.
*
+ * This function must not be called concurrently with itself or kvfree() for the
+ * same memory allocation.
+ *
* Return: pointer to the allocated memory or %NULL in case of error
*/
void *kvrealloc_noprof(const void *p, size_t size, gfp_t flags)