From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: [PATCH] msix: fix crash on msix_irq_entries access Date: Wed, 20 Oct 2010 06:50:18 +0200 Message-ID: <20101020045017.GA10096@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: kvm@vger.kernel.org, mtosatti@redhat.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45969 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750743Ab0JTE4v (ORCPT ); Wed, 20 Oct 2010 00:56:51 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9K4uowU017172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Oct 2010 00:56:50 -0400 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Since commit 889e30cc18e21f2091b77267dca8096d7dd34f8b, msix.c doesn't include kvm/h anymore, so KVM_IRQCHIP is never defined, and msix_irq_entries ends up as NULL. Signed-off-by: Michael S. Tsirkin --- hw/msix.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/hw/msix.c b/hw/msix.c index 43efbd2..f12e4aa 100644 --- a/hw/msix.c +++ b/hw/msix.c @@ -389,12 +389,10 @@ int msix_init(struct PCIDevice *dev, unsigned short nentries, if (ret) goto err_config; -#ifdef KVM_CAP_IRQCHIP if (kvm_enabled() && kvm_irqchip_in_kernel()) { dev->msix_irq_entries = qemu_malloc(nentries * sizeof *dev->msix_irq_entries); } -#endif dev->cap_present |= QEMU_PCI_CAP_MSIX; return 0; -- 1.7.3-rc1