From patchwork Mon Feb 18 13:06:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 10817969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E0A817E9 for ; Mon, 18 Feb 2019 13:09:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F045C2AA5B for ; Mon, 18 Feb 2019 13:09:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E433B2AA67; Mon, 18 Feb 2019 13:09:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 058182AA66 for ; Mon, 18 Feb 2019 13:09:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730892AbfBRNJ4 (ORCPT ); Mon, 18 Feb 2019 08:09:56 -0500 Received: from foss.arm.com ([217.140.101.70]:57976 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730512AbfBRNJ4 (ORCPT ); Mon, 18 Feb 2019 08:09:56 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3EBBE15AB; Mon, 18 Feb 2019 05:09:55 -0800 (PST) Received: from ostrya.cambridge.arm.com (ostrya.cambridge.arm.com [10.1.197.2]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6CB5B3F720; Mon, 18 Feb 2019 05:09:54 -0800 (PST) From: Jean-Philippe Brucker To: kvm@vger.kernel.org Cc: will.deacon@arm.com, andre.przywara@arm.com Subject: [PATCH kvmtool 1/9] qcow: Fix qcow1 exit fault Date: Mon, 18 Feb 2019 13:06:54 +0000 Message-Id: <20190218130702.32575-2-jean-philippe.brucker@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218130702.32575-1-jean-philippe.brucker@arm.com> References: <20190218130702.32575-1-jean-philippe.brucker@arm.com> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Even though qcow1 doesn't use the refcount table, the cleanup path still attempts to iterate over its LRU list. Initialize the list to avoid a segfault on exit. Signed-off-by: Jean-Philippe Brucker Reviewed-by: Andre Przywara --- disk/qcow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/disk/qcow.c b/disk/qcow.c index 64cf9270a..bed70c65c 100644 --- a/disk/qcow.c +++ b/disk/qcow.c @@ -1437,6 +1437,7 @@ static struct disk_image *qcow1_probe(int fd, bool readonly) l1t->root = (struct rb_root)RB_ROOT; INIT_LIST_HEAD(&l1t->lru_list); + INIT_LIST_HEAD(&q->refcount_table.lru_list); h = q->header = qcow1_read_header(fd); if (!h)