On Fri, 4 Nov 2022 at 21:04, <nyoro.ga...@gmail.com> wrote: > > From: Samker <samkerga...@gmail.com> ... > Signed-off-by: M N Gachu <nyoro.ga...@gmail.com>
The author and Signed-off-by name/email are different. Do you want to use a single name/email? > --- > softmmu/physmem.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/softmmu/physmem.c b/softmmu/physmem.c > index d9578ccfd4..fb00596777 100644 > --- a/softmmu/physmem.c > +++ b/softmmu/physmem.c > @@ -24,6 +24,7 @@ > #include "qemu/cutils.h" > #include "qemu/cacheflush.h" > #include "qemu/madvise.h" > +#include "qemu/lockable.h" > > #ifdef CONFIG_TCG > #include "hw/core/tcg-cpu-ops.h" > @@ -3114,13 +3115,12 @@ void cpu_register_map_client(QEMUBH *bh) > { > MapClient *client = g_malloc(sizeof(*client)); > > - qemu_mutex_lock(&map_client_list_lock); > + WITH_QEMU_LOCK_GUARD(&map_client_list_lock); There is a bug here: the lock won't be held after this line because WITH_QEMU_LOCK_GUARD() is block scoped. It requires curly braces: WITH_QEMU_LOCK_GUARD(&lock) { ...protected code... } ...unprotected code... Use QEMU_LOCK_GUARD(&lock); when don't want block scope. It holds the lock for the remainder of the function.