From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PULL 14/17] tests: vhost-user-test: release mutex on protocol violation
Date: Sat, 29 Apr 2023 14:16:33 +0200 [thread overview]
Message-ID: <20230429121636.230934-15-pbonzini@redhat.com> (raw)
In-Reply-To: <20230429121636.230934-1-pbonzini@redhat.com>
chr_read() is printing an error message and returning with s->data_mutex taken.
This can potentially cause a hang. Reported by Coverity.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qtest/vhost-user-test.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
index bf9f7c4248ca..e4f95b2858f0 100644
--- a/tests/qtest/vhost-user-test.c
+++ b/tests/qtest/vhost-user-test.c
@@ -351,7 +351,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
if (size != msg.size) {
qos_printf("%s: Wrong message size received %d != %d\n",
__func__, size, msg.size);
- return;
+ goto out;
}
}
@@ -509,6 +509,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
break;
}
+out:
g_mutex_unlock(&s->data_mutex);
}
--
2.40.0
next prev parent reply other threads:[~2023-04-29 12:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-29 12:16 [PULL 00/17] Misc patches for 2023-04-29 Paolo Bonzini
2023-04-29 12:16 ` [PULL 01/17] qapi, i386/sev: Change the reduced-phys-bits value from 5 to 1 Paolo Bonzini
2023-04-29 12:16 ` [PULL 02/17] qemu-options.hx: Update the reduced-phys-bits documentation Paolo Bonzini
2023-04-29 12:16 ` [PULL 03/17] i386/sev: Update checks and information related to reduced-phys-bits Paolo Bonzini
2023-04-29 12:16 ` [PULL 04/17] i386/cpu: Update how the EBX register of CPUID 0x8000001F is set Paolo Bonzini
2023-04-29 12:16 ` [PULL 05/17] target/i386: Add support for CMPCCXADD in CPUID enumeration Paolo Bonzini
2023-04-29 12:16 ` [PULL 06/17] target/i386: Add support for AMX-FP16 " Paolo Bonzini
2023-04-29 12:16 ` [PULL 07/17] target/i386: Add support for AVX-IFMA " Paolo Bonzini
2023-04-29 12:16 ` [PULL 08/17] target/i386: Add support for AVX-VNNI-INT8 " Paolo Bonzini
2023-04-29 12:16 ` [PULL 09/17] target/i386: Add support for AVX-NE-CONVERT " Paolo Bonzini
2023-04-29 12:16 ` [PULL 10/17] target/i386: Add support for PREFETCHIT0/1 " Paolo Bonzini
2023-04-29 12:16 ` [PULL 11/17] Fix libvhost-user.c compilation Paolo Bonzini
2023-04-29 12:16 ` [PULL 12/17] update-linux-headers.sh: Add missing kernel headers Paolo Bonzini
2023-04-29 12:16 ` [PULL 13/17] Update linux headers to v6.3rc5 Paolo Bonzini
2023-04-29 12:16 ` Paolo Bonzini [this message]
2023-04-29 12:16 ` [PULL 15/17] target/hexagon: fix = vs. == mishap Paolo Bonzini
2023-04-29 12:16 ` [PULL 16/17] async: Suppress GCC13 false positive in aio_bh_poll() Paolo Bonzini
2023-04-29 12:16 ` [PULL 17/17] cpus-common: stop using mb_set/mb_read Paolo Bonzini
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=20230429121636.230934-15-pbonzini@redhat.com \
--to=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).