From 96ffccef5a5f598ffbd263971b92132391f1606a Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 6 May 2026 13:59:37 +0200 Subject: [PATCH] xvmalloc: adjust XVFREE() ordering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What c4f427ec879e ("xen: Swap order of actions in the FREE*() macros") did should have been done right away when XVFREE() was introduced. Fixes: 9102fcd9579f ("mm: introduce xvmalloc() et al and use for grant table allocations") Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné --- xen/include/xen/xvmalloc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h index 110b10e88c..83c9d4dea2 100644 --- a/xen/include/xen/xvmalloc.h +++ b/xen/include/xen/xvmalloc.h @@ -71,8 +71,9 @@ void *_xvrealloc(void *va, size_t size, unsigned int align); /* Free an allocation, and zero the pointer to it. */ #define XVFREE(p) do { \ - xvfree(p); \ + void *_ptr_ = (p); \ (p) = NULL; \ + xvfree(_ptr_); \ } while ( false ) static inline void *_xvmalloc_array(