On Tue, 15 Oct 2013 16:52:44 +0200 Paolo Bonzini <pbonz...@redhat.com> wrote:
> The vdev field is complicated to synchronize. Just access the > BusState's list of children. > > Cc: qemu-sta...@nongnu.org > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > --- > hw/s390x/virtio-ccw.c | 80 > ++++++++++++++++++++++++++++----------------------- > hw/s390x/virtio-ccw.h | 1 - > 2 files changed, 44 insertions(+), 37 deletions(-) > > diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c > index a6accdf..753b7e1 100644 > --- a/hw/s390x/virtio-ccw.c > +++ b/hw/s390x/virtio-ccw.c > @@ -230,6 +236,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) > hwaddr indicators; > VqConfigBlock vq_config; > VirtioCcwDevice *dev = sch->driver_data; > + VirtIODevice *vdev = virtio_bus_get_device(&dev->bus); You dereference dev before it is checked against NULL. While that should not happen, I'd prefer virtio_ccw_get_vdev() instead. > bool check_len; > int len; > hwaddr hw_len; Otherwise: Reviewed-by: Cornelia Huck <cornelia.h...@de.ibm.com>