All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xvmalloc: adjust XVFREE() ordering
@ 2026-04-16 14:32 Jan Beulich
  2026-04-16 14:39 ` Roger Pau Monné
  2026-04-21 10:04 ` Jan Beulich
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Beulich @ 2026-04-16 14:32 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Anthony PERARD,
	Michal Orzel, Roger Pau Monné

What c4f427ec879e ("xen: Swap order of actions in the FREE*() macros") did
should have been done right away when XVFREE() was introduced.

Amends: 9102fcd9579f ("mm: introduce xvmalloc() et al and use for grant table allocations")
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xen/xvmalloc.h
+++ b/xen/include/xen/xvmalloc.h
@@ -71,8 +71,9 @@ void *_xvrealloc(void *va, size_t size,
 
 /* 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(


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-21 10:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-16 14:32 [PATCH] xvmalloc: adjust XVFREE() ordering Jan Beulich
2026-04-16 14:39 ` Roger Pau Monné
2026-04-16 14:50   ` Jan Beulich
2026-04-16 15:08     ` Andrew Cooper
2026-04-21 10:04 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.