lib/vmalloc: fix potential race and non-standard pointer arithmetic
The pointer vfree_top should only be accessed with the lock held, so make sure we return a local copy of the pointer taken safely inside the lock. Also avoid doing pointer arithmetic on void pointers. Gcc allows it but it is ugly. Use uintptr_t for doing maths on the pointer. This will also come useful in upcoming patches. Signed-off-by:Claudio Imbrenda <imbrenda@linux.ibm.com> Message-Id: <20200622162141.279716-7-imbrenda@linux.ibm.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
Loading
Please register or sign in to comment