Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP3:Update
xen
xsa453-2.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xsa453-2.patch of Package xen
From: Andrew Cooper <andrew.cooper3@citrix.com> Subject: xen: Swap order of actions in the FREE*() macros Wherever possible, it is a good idea to NULL out the visible reference to an object prior to freeing it. The FREE*() macros already collect together both parts, making it easy to adjust. This has a marginal code generation improvement, as some of the calls to the free() function can be tailcall optimised. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Jan Beulich <jbeulich@suse.com> (cherry picked from commit c4f427ec879e7c0df6d44d02561e8bee838a293e) --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -170,8 +170,9 @@ bool scrub_free_pages(void); /* Free an allocation, and zero the pointer to it. */ #define FREE_XENHEAP_PAGES(p, o) do { \ - free_xenheap_pages(p, o); \ + void *_ptr_ = (p); \ (p) = NULL; \ + free_xenheap_pages(_ptr_, o); \ } while ( false ) #define FREE_XENHEAP_PAGE(p) FREE_XENHEAP_PAGES(p, 0) --- a/xen/include/xen/xmalloc.h +++ b/xen/include/xen/xmalloc.h @@ -66,9 +66,10 @@ extern void xfree(void *); /* Free an allocation, and zero the pointer to it. */ -#define XFREE(p) do { \ - xfree(p); \ - (p) = NULL; \ +#define XFREE(p) do { \ + void *_ptr_ = (p); \ + (p) = NULL; \ + xfree(_ptr_); \ } while ( false ) /* Underlying functions */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor