From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW71o-0006zh-9r for qemu-devel@nongnu.org; Tue, 15 Oct 2013 11:59:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VW71i-0007GW-ER for qemu-devel@nongnu.org; Tue, 15 Oct 2013 11:59:24 -0400 Sender: Paolo Bonzini Message-ID: <525D6644.6050506@redhat.com> Date: Tue, 15 Oct 2013 17:59:00 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1381848773-689-1-git-send-email-pbonzini@redhat.com> <1381848773-689-4-git-send-email-pbonzini@redhat.com> <20131015171900.41b64b45@gondolin> In-Reply-To: <20131015171900.41b64b45@gondolin> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 03/12] virtio-ccw: remove vdev field List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: mst@redhat.com, qemu-stable@nongnu.org, afaerber@suse.de, qemu-devel@nongnu.org Il 15/10/2013 17:19, Cornelia Huck ha scritto: > >> > The vdev field is complicated to synchronize. Just access the >> > BusState's list of children. >> > >> > Cc: qemu-stable@nongnu.org >> > Signed-off-by: Paolo Bonzini >> > --- >> > 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. > Thanks, will do. Paolo