aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChangpeng Liu <changpeng.liu@intel.com>2022-05-25 20:55:39 +0800
committerMichael S. Tsirkin <mst@redhat.com>2022-06-09 19:32:49 -0400
commitfb38d0c97dd665f7e0c1cb8176090500ce2275e1 (patch)
treea330ec8cbea0a4e65cb8e6ec567878cc170a87fd
parent5060004c303ce564e6ddb87d8255b7741870f9d6 (diff)
downloadqemu-fb38d0c97dd665f7e0c1cb8176090500ce2275e1.zip
qemu-fb38d0c97dd665f7e0c1cb8176090500ce2275e1.tar.gz
qemu-fb38d0c97dd665f7e0c1cb8176090500ce2275e1.tar.bz2
hw/virtio/vhost-user: don't use uninitialized variable
Variable `vdev` in `struct vhost_dev` will not be ready until start the device, so let's not use it for the error output here. Fixes: 5653493 ("hw/virtio/vhost-user: don't suppress F_CONFIG when supported") Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Message-Id: <20220525125540.50979-1-changpeng.liu@intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Fixes: 5653493 ("hw/virtio/vhost-user: don't suppress F_CONFIG when supported") Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Fixes: 5653493 ("hw/virtio/vhost-user: don't suppress F_CONFIG when supported") Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
-rw-r--r--hw/virtio/vhost-user.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index b040c1a..0594178 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -2031,18 +2031,16 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque,
if (supports_f_config) {
if (!virtio_has_feature(protocol_features,
VHOST_USER_PROTOCOL_F_CONFIG)) {
- error_setg(errp, "vhost-user device %s expecting "
+ error_setg(errp, "vhost-user device expecting "
"VHOST_USER_PROTOCOL_F_CONFIG but the vhost-user backend does "
- "not support it.", dev->vdev->name);
+ "not support it.");
return -EPROTO;
}
} else {
if (virtio_has_feature(protocol_features,
VHOST_USER_PROTOCOL_F_CONFIG)) {
warn_reportf_err(*errp, "vhost-user backend supports "
- "VHOST_USER_PROTOCOL_F_CONFIG for "
- "device %s but QEMU does not.",
- dev->vdev->name);
+ "VHOST_USER_PROTOCOL_F_CONFIG but QEMU does not.");
protocol_features &= ~(1ULL << VHOST_USER_PROTOCOL_F_CONFIG);
}
}