]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/virtio/vhost-user: avoid using unitialized errp
authorAlbert Esteve <aesteve@redhat.com>
Thu, 2 Mar 2023 12:17:19 +0000 (13:17 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 18 May 2023 18:09:59 +0000 (21:09 +0300)
commita641521e50c1664582568af3f169d51524767f30
tree44cb1c2d2cdf96c0e42cb613329c3ab466f86282
parentafc11df42a031ae8b583c1480c5b1460b4eb84c5
hw/virtio/vhost-user: avoid using unitialized errp

During protocol negotiation, when we the QEMU
stub does not support a backend with F_CONFIG,
it throws a warning and supresses the
VHOST_USER_PROTOCOL_F_CONFIG bit.

However, the warning uses warn_reportf_err macro
and passes an unitialized errp pointer. However,
the macro tries to edit the 'msg' member of the
unitialized Error and segfaults.

Instead, just use warn_report, which prints a
warning message directly to the output.

Fixes: 5653493 ("hw/virtio/vhost-user: don't suppress F_CONFIG when supported")
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Message-Id: <20230302121719.9390-1-aesteve@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 90e31232cf8fa7f257263dd431ea954a1ae54bff)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/virtio/vhost-user.c