From patchwork Tue Jun 27 17:47:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 9812919 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 036F06020A for ; Tue, 27 Jun 2017 17:50:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA83928718 for ; Tue, 27 Jun 2017 17:50:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEF7328722; Tue, 27 Jun 2017 17:50:45 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 25E8928718 for ; Tue, 27 Jun 2017 17:50:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPubR-0003Ln-BB; Tue, 27 Jun 2017 17:48:41 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPubQ-0003Lb-68 for xen-devel@lists.xen.org; Tue, 27 Jun 2017 17:48:40 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id E7/65-03371-77A92595; Tue, 27 Jun 2017 17:48:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjkeJIrShJLcpLzFFi42JxWrrBXrd8VlC kQV8ri8WSj4tZHBg9ju7+zRTAGMWamZeUX5HAmrFt3mfWgqWcFcembGdsYFzG1sXIySEh4C+x fPsDFhCbTUBfYveLT0wgtoiAusTpjousXYxcHMwCvYwSFyfuZgdJCAs4SCy91s4KYrMIqErcb rnECGLzCnhKLHvYBjVUTuL88Z/MEHFBiZMzn4AtYBbQlGjd/psdwpaXaN46G6xGSEBN4lr/Jf YJjDyzkLTMQtIyC0nLAkbmVYwaxalFZalFuoZGeklFmekZJbmJmTm6hgZmermpxcWJ6ak5iUn Fesn5uZsYgeHDAAQ7GC9vDDjEKMnBpCTKe6ozKFKILyk/pTIjsTgjvqg0J7X4EKMMB4eSBO++ GUA5waLU9NSKtMwcYCDDpCU4eJREeMWmA6V5iwsSc4sz0yFSpxgVpcR5/4D0CYAkMkrz4Npg0 XOJUVZKmJcR6BAhnoLUotzMElT5V4ziHIxKwrwHQabwZOaVwE1/BbSYCWgxy7wAkMUliQgpqQ bG2uj8VR9Ujs4+1CZ6xUCOaRnT8i0GUufv/GYqlXnvnDkhV+bi7S36exi2z9ztxR2d6yrQ2JC 9T2Ttg66NL5iC6pnuTC5VtXmhkqeQc7PQUfNj4ivR5gdPLx64vL+XeeXmsgz24q2Bso32d/bd ai80uXl9mcnzq7N2aLB8VbEWmadlcbFq35UOJZbijERDLeai4kQAJHG6kZkCAAA= X-Env-Sender: prvs=344358ddb=Andrew.Cooper3@citrix.com X-Msg-Ref: server-6.tower-27.messagelabs.com!1498585717!109914420!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30944 invoked from network); 27 Jun 2017 17:48:38 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 27 Jun 2017 17:48:38 -0000 X-IronPort-AV: E=Sophos;i="5.40,271,1496102400"; d="scan'208";a="438026170" From: Andrew Cooper To: Xen-devel Date: Tue, 27 Jun 2017 18:47:52 +0100 Message-ID: <1498585673-23268-1-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [Xen-devel] [PATCH 1/2] xen/pt: Unlock d->event_lock on error paths X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Introduced by c/s fba00494268 "x86/pt: enable binding of GSIs to a PVH Dom0" Spotted by Coverity. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monné --- xen/drivers/passthrough/io.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c index 2fdbba6..25e3fb4 100644 --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -490,7 +490,11 @@ int pt_irq_create_bind( /* MSI_TRANSLATE is not supported for the hardware domain. */ if ( pt_irq_bind->irq_type != PT_IRQ_TYPE_PCI || pirq >= hvm_domain_irq(d)->nr_gsis ) + { + spin_unlock(&d->event_lock); + return -EINVAL; + } guest_gsi = pirq; } @@ -523,6 +527,8 @@ int pt_irq_create_bind( if ( mask < 0 || trigger_mode < 0 ) { + spin_unlock(&d->event_lock); + ASSERT_UNREACHABLE(); return -EINVAL; }