From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z317c-0006TM-1a for qemu-devel@nongnu.org; Thu, 11 Jun 2015 07:58:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z317a-0006LJ-5f for qemu-devel@nongnu.org; Thu, 11 Jun 2015 07:58:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z317a-0006LF-0i for qemu-devel@nongnu.org; Thu, 11 Jun 2015 07:58:10 -0400 Date: Thu, 11 Jun 2015 13:58:06 +0200 From: "Michael S. Tsirkin" Message-ID: <1434023714-30366-2-git-send-email-mst@redhat.com> References: <1434023714-30366-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1434023714-30366-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 01/42] vhost: put log correctly in vhost_dev_start() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Jason Wang From: Jason Wang We allocate an dummy log even if the size is zero. So we should put it unconditionally too. Signed-off-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 01f1e04..3a52a4d 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1111,9 +1111,7 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev) return 0; fail_log: - if (hdev->log_size) { - vhost_log_put(hdev, false); - } + vhost_log_put(hdev, false); fail_vq: while (--i >= 0) { vhost_virtqueue_stop(hdev, -- MST