Skip to content
Commit 4aabe7c0 authored by Claudio Imbrenda's avatar Claudio Imbrenda Committed by Paolo Bonzini
Browse files

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: default avatarClaudio Imbrenda <imbrenda@linux.ibm.com>
Message-Id: <20200622162141.279716-7-imbrenda@linux.ibm.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent dee4223b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment