From: David Hildenbrand Date: Tue, 11 Jan 2022 12:08:30 +0000 (+0100) Subject: util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=dd4fc6058557cd2a9e23a37da44d054f724ca3e8;p=qemu.git util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc() We're missing an unlock in case installing the signal handler failed. Fortunately, we barely see this error in real life. Fixes: a960d6642d39 ("util/oslib-posix: Support concurrent os_mem_prealloc() invocation") Fixes: CID 1468941 Cc: Paolo Bonzini Cc: Michael S. Tsirkin Cc: Pankaj Gupta Cc: Daniel P. Berrangé Cc: Michal Privoznik Signed-off-by: David Hildenbrand Message-Id: <20220111120830.119912-1-david@redhat.com> Reviewed-by: Pankaj Gupta Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 9efdc74bba..ac0dbc2adc 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -683,6 +683,7 @@ void os_mem_prealloc(int fd, char *area, size_t memory, int smp_cpus, ret = sigaction(SIGBUS, &act, &sigbus_oldact); if (ret) { + qemu_mutex_unlock(&sigbus_mutex); error_setg_errno(errp, errno, "os_mem_prealloc: failed to install signal handler"); return;