util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc()
PATCH 1/1 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 <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Pankaj Gupta <[email protected]>
Cc Daniel P. Berrangé <[email protected]>
Cc Michal Privoznik <[email protected]>
Signed-off-by David Hildenbrand <[email protected]>
--- util/oslib-posix.c | 1 + 1 file changed, 1 insertion(+)
util/oslib-posix.c +1 -0
@@ -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 ;
Signature · 1 line
2.33.1
Quoted 20 lines
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 1468941Cc Paolo Bonzini <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Pankaj Gupta <[email protected]>Cc Daniel P. Berrangé <[email protected]>Cc Michal Privoznik <[email protected]>Signed-off-by David Hildenbrand <[email protected]>--- util/oslib-posix.c | 1 + 1 file changed, 1 insertion(+)util/oslib-posix.c +0
-0
util/oslib-posix.c void os_mem_prealloc(int fd, char *area, size_t memory, int smp_cpus,
Quoted 8 lines
util/oslib-posix.c +1
-1@@ -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 ; --
Reviewed-by Pankaj Gupta <[email protected]>
Quoted 2 lines
2.33.1