[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 24/24] util/oslib-posix: Fix missing unlock in the error path o
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 24/24] util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc() |
Date: |
Sun, 6 Feb 2022 04:38:50 -0500 |
From: David Hildenbrand <david@redhat.com>
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 <pbonzini@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Pankaj Gupta <pankaj.gupta@ionos.com>
Cc: Daniel P. Berrangé <berrange@redhat.com>
Cc: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20220111120830.119912-1-david@redhat.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
util/oslib-posix.c | 1 +
1 file changed, 1 insertion(+)
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;
--
MST
- [PULL v2 12/24] libvhost-user: prevent over-running max RAM slots, (continued)
- [PULL v2 12/24] libvhost-user: prevent over-running max RAM slots, Michael S. Tsirkin, 2022/02/06
- [PULL v2 14/24] libvhost-user: Map shared RAM with MAP_NORESERVE to support virtio-mem with hugetlb, Michael S. Tsirkin, 2022/02/06
- [PULL v2 15/24] ACPI ERST: bios-tables-test.c steps 1 and 2, Michael S. Tsirkin, 2022/02/06
- [PULL v2 16/24] ACPI ERST: PCI device_id for ERST, Michael S. Tsirkin, 2022/02/06
- [PULL v2 17/24] ACPI ERST: header file for ERST, Michael S. Tsirkin, 2022/02/06
- [PULL v2 19/24] ACPI ERST: build the ACPI ERST table, Michael S. Tsirkin, 2022/02/06
- [PULL v2 18/24] ACPI ERST: support for ACPI ERST feature, Michael S. Tsirkin, 2022/02/06
- [PULL v2 20/24] ACPI ERST: create ACPI ERST table for pc/x86 machines, Michael S. Tsirkin, 2022/02/06
- [PULL v2 21/24] ACPI ERST: qtest for ERST, Michael S. Tsirkin, 2022/02/06
- [PULL v2 22/24] ACPI ERST: bios-tables-test testcase, Michael S. Tsirkin, 2022/02/06
- [PULL v2 24/24] util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc(),
Michael S. Tsirkin <=
- [PULL v2 23/24] ACPI ERST: step 6 of bios-tables-test.c, Michael S. Tsirkin, 2022/02/06
- [PULL v2 11/24] libvhost-user: fix VHOST_USER_REM_MEM_REG not closing the fd, Michael S. Tsirkin, 2022/02/06
- Re: [PULL v2 00/24] virtio,pc: features, cleanups, fixes, Peter Maydell, 2022/02/06