From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW6Zv-00025N-4R for qemu-devel@nongnu.org; Tue, 15 Oct 2013 11:30:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VW6Zm-0006H9-UN for qemu-devel@nongnu.org; Tue, 15 Oct 2013 11:30:35 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:53936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW6Zm-0006Gf-JX for qemu-devel@nongnu.org; Tue, 15 Oct 2013 11:30:26 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 15 Oct 2013 16:30:24 +0100 Date: Tue, 15 Oct 2013 17:19:00 +0200 From: Cornelia Huck Message-ID: <20131015171900.41b64b45@gondolin> In-Reply-To: <1381848773-689-4-git-send-email-pbonzini@redhat.com> References: <1381848773-689-1-git-send-email-pbonzini@redhat.com> <1381848773-689-4-git-send-email-pbonzini@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: Paolo Bonzini Cc: qemu-stable@nongnu.org, qemu-devel@nongnu.org, afaerber@suse.de, mst@redhat.com On Tue, 15 Oct 2013 16:52:44 +0200 Paolo Bonzini wrote: > 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. > bool check_len; > int len; > hwaddr hw_len; Otherwise: Reviewed-by: Cornelia Huck