[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xvmalloc: adjust XVFREE() ordering



commit 96ffccef5a5f598ffbd263971b92132391f1606a
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed May 6 13:59:37 2026 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed May 6 15:11:11 2026 +0200

    xvmalloc: adjust XVFREE() ordering
    
    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 <jbeulich@xxxxxxxx>
    Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 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(
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.