On Tue, Jul 23, 2024 at 06:39:39PM +0200, Hanna Czenczek wrote: > Historically, .get_vhost() was probably only called when > vdev->vhost_started is true. However, we now decidedly want to call it > also when vhost_started is false, specifically so we can issue a reset > to the vhost back-end while device operation is stopped. > > Some .get_vhost() implementations dereference some pointers (or return > offsets from them) that are probably guaranteed to be non-NULL when > vhost_started is true, but not necessarily otherwise. This patch makes > all such implementations check all such pointers, returning NULL if any > is NULL. > > Signed-off-by: Hanna Czenczek <hre...@redhat.com> > --- > include/hw/virtio/virtio.h | 1 + > hw/display/vhost-user-gpu.c | 2 +- > hw/net/virtio-net.c | 19 +++++++++++++++++-- > hw/virtio/virtio-crypto.c | 18 +++++++++++++++--- > 4 files changed, 34 insertions(+), 6 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
signature.asc
Description: PGP signature