From: Pankaj Gupta <pankaj.gupta@ionos.com>
To: David Hildenbrand <david@redhat.com>
Cc: "Michal Privoznik" <mprivozn@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
qemu-devel@nongnu.org, "Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v1] util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc()
Date: Tue, 11 Jan 2022 13:56:24 +0100 [thread overview]
Message-ID: <CALzYo313D++5d3QBee56qspcgDHLqGuu4a+RA99KLtrw7hhGKg@mail.gmail.com> (raw)
In-Reply-To: <20220111120830.119912-1-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>
> ---
> 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;
> --
Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com>
> 2.33.1
>
prev parent reply other threads:[~2022-01-11 13:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-11 12:08 [PATCH v1] util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc() David Hildenbrand
2022-01-11 12:56 ` Pankaj Gupta [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALzYo313D++5d3QBee56qspcgDHLqGuu4a+RA99KLtrw7hhGKg@mail.gmail.com \
--to=pankaj.gupta@ionos.com \
--cc=berrange@redhat.com \
--cc=david@redhat.com \
--cc=mprivozn@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).