summaryrefslogtreecommitdiffstats
path: root/chardev/char-socket.c
diff options
context:
space:
mode:
authorPeter Maydell2018-07-06 19:18:08 +0200
committerPeter Maydell2018-07-06 19:18:08 +0200
commit43a473993fd9378bf850dcafa68eb6dee8c300f8 (patch)
treec24e382dbfbbeca0a84f219766ee9a0edd523b2a /chardev/char-socket.c
parenttests/migration: Skip tests for ppc tcg (diff)
parentcheckpatch: handle token pasting better (diff)
downloadqemu-43a473993fd9378bf850dcafa68eb6dee8c300f8.tar.gz
qemu-43a473993fd9378bf850dcafa68eb6dee8c300f8.tar.xz
qemu-43a473993fd9378bf850dcafa68eb6dee8c300f8.zip
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Bug fixes. # gpg: Signature made Fri 06 Jul 2018 17:40:06 BST # gpg: using RSA key BFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: checkpatch: handle token pasting better ioapic: remove useless lower bounds check pr-manager-helper: fix memory leak on event qemu-char: check errno together with ret < 0 i386: fix '-cpu ?' output for host cpu type qtest: Use cpu address space instead of system memory pr-helper: Rework socket path handling pr-helper: avoid error on PR IN command with zero request size Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'chardev/char-socket.c')
-rw-r--r--chardev/char-socket.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 17519ec589..efbad6ee7c 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -134,8 +134,11 @@ static int tcp_chr_write(Chardev *chr, const uint8_t *buf, int len)
s->write_msgfds,
s->write_msgfds_num);
- /* free the written msgfds in any cases other than errno==EAGAIN */
- if (EAGAIN != errno && s->write_msgfds_num) {
+ /* free the written msgfds in any cases
+ * other than ret < 0 && errno == EAGAIN
+ */
+ if (!(ret < 0 && EAGAIN == errno)
+ && s->write_msgfds_num) {
g_free(s->write_msgfds);
s->write_msgfds = 0;
s->write_msgfds_num = 0;