From patchwork Thu May 5 10:58:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 94246 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6D3C4B6F76 for ; Thu, 5 May 2011 21:04:49 +1000 (EST) Received: from localhost ([::1]:34885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHwMQ-0003Iq-9T for incoming@patchwork.ozlabs.org; Thu, 05 May 2011 07:04:46 -0400 Received: from eggs.gnu.org ([140.186.70.92]:49801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHwH7-00023Y-53 for qemu-devel@nongnu.org; Thu, 05 May 2011 06:59:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHwH6-0003yx-Fn for qemu-devel@nongnu.org; Thu, 05 May 2011 06:59:17 -0400 Received: from smtp.citrix.com ([66.165.176.89]:58460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHwH6-0003tE-CG for qemu-devel@nongnu.org; Thu, 05 May 2011 06:59:16 -0400 X-IronPort-AV: E=Sophos;i="4.64,318,1301889600"; d="scan'208";a="13957044" Received: from ftlpmailmx01.citrite.net ([10.13.107.65]) by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5; 05 May 2011 06:59:16 -0400 Received: from smtp01.ad.xensource.com (10.219.128.104) by smtprelay.citrix.com (10.13.107.65) with Microsoft SMTP Server id 8.3.137.0; Thu, 5 May 2011 06:59:15 -0400 Received: from perard.uk.xensource.com (dhcp-3-28.uk.xensource.com [10.80.3.28]) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id p45AwmIq029731; Thu, 5 May 2011 03:59:13 -0700 From: To: QEMU-devel , Anthony Liguori , Alexander Graf Date: Thu, 5 May 2011 11:58:29 +0100 Message-ID: <1304593113-10689-15-git-send-email-anthony.perard@citrix.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1304593113-10689-1-git-send-email-anthony.perard@citrix.com> References: <1304593113-10689-1-git-send-email-anthony.perard@citrix.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Cc: Anthony PERARD , John Baboval , Xen Devel , Stefano Stabellini Subject: [Qemu-devel] [PATCH V15 14/18] pci: Use of qemu_put_ram_ptr in pci_add_option_rom. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: John Baboval Prevent a deadlock caused by leaving a map cache bucket locked by the preceding qemu_get_ram_ptr() call. Signed-off-By: John Baboval Signed-off-by: Anthony PERARD --- hw/pci.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 6b577e1..2b24dd4 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -1897,6 +1897,8 @@ static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom) pci_patch_ids(pdev, ptr, size); } + qemu_put_ram_ptr(ptr); + pci_register_bar(pdev, PCI_ROM_SLOT, size, 0, pci_map_option_rom);