From patchwork Wed Aug 3 17:27:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Vrabel X-Patchwork-Id: 9261665 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 F095560865 for ; Wed, 3 Aug 2016 17:30:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0FFA26E69 for ; Wed, 3 Aug 2016 17:30:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D487828111; Wed, 3 Aug 2016 17:30:55 +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 84D9B28210 for ; Wed, 3 Aug 2016 17:30:55 +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 1bUzxi-0005FD-0D; Wed, 03 Aug 2016 17:28:10 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUzxg-0005Ew-Pw for xen-devel@lists.xenproject.org; Wed, 03 Aug 2016 17:28:08 +0000 Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id 65/CE-17024-8A922A75; Wed, 03 Aug 2016 17:28:08 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDIsWRWlGSWpSXmKPExsXitHSDve5yzUX hBieWK1p83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBlts1awFzxirTgy9TVbA+Mjli5GTg4JAX+J 9yv3MIHYbAI6Eo+XzGDvYuTgEBFQkbi916CLkYuDWWAbo8T/9ouMIDXCAoESc1ZfYgexWYBqp l76xAxSzyvgLjHvgATESDmJ88d/MoPYnAIeEk9mvmYDsYWASm59esoIYatIfFy7ihXE5hUQlD g58wnYOcwCEhIHX7xghpjDLXH79FTmCYx8s5CUzUJStoCRaRWjRnFqUVlqka6RhV5SUWZ6Rkl uYmaOrqGhiV5uanFxYnpqTmJSsV5yfu4mRmBI1TMwMO5gXHfc7xCjJAeTkijvxIMLw4X4kvJT KjMSizPii0pzUosPMcpwcChJ8DJqLAoXEixKTU+tSMvMAQY3TFqCg0dJhPewOlCat7ggMbc4M x0idYpRl2PBj9trmYRY8vLzUqXEeV1AZgiAFGWU5sGNgEXaJUZZKWFeRgYGBiGegtSi3MwSVP lXjOIcjErCvDkgU3gy80rgNr0COoIJ6IgTBgtAjihJREhJNTBWWN36trl8UbqIc3PPrQ+6wnV /dD62Pw5asP/d82J2yTdvrxxmNE/cnzT15a685UZ393leZ0pa8ys+8uie99Le4nc4Vx6wlmi+ duJzIYfWxoX2D+NLdnq9OaJw1ofpfMaa2Z6/r0xZFbtpQbiE2qeqT5f+JaScmh33s0LCa/npb 9LPiy4yX9nxQ4mlOCPRUIu5qDgRAI2Gb+6vAgAA X-Env-Sender: prvs=016c44363=david.vrabel@citrix.com X-Msg-Ref: server-4.tower-27.messagelabs.com!1470245286!56775565!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: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 63875 invoked from network); 3 Aug 2016 17:28:07 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 3 Aug 2016 17:28:07 -0000 X-IronPort-AV: E=Sophos;i="5.28,466,1464652800"; d="scan'208";a="377270379" From: David Vrabel To: Date: Wed, 3 Aug 2016 18:27:51 +0100 Message-ID: <1470245271-31109-3-git-send-email-david.vrabel@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1470245271-31109-1-git-send-email-david.vrabel@citrix.com> References: <1470245271-31109-1-git-send-email-david.vrabel@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Stefano Stabellini , Ian Jackson , David Vrabel , Ian Campbell Subject: [Xen-devel] [PATCHv1 2/2] libxencall: release the buffer cache before closing the fd 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 Freeing a buffer may now call the IOCTL_PRIVCMD_HCALL_BUF_UNLOCK ioctl on the fd, so the fd should only be closed after the buffer cache is released. Signed-off-by: David Vrabel --- tools/libs/call/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c index 5ca0372..578815a 100644 --- a/tools/libs/call/core.c +++ b/tools/libs/call/core.c @@ -65,8 +65,8 @@ int xencall_close(xencall_handle *xcall) if ( !xcall ) return 0; - rc = osdep_xencall_close(xcall); buffer_release_cache(xcall); + rc = osdep_xencall_close(xcall); xtl_logger_destroy(xcall->logger_tofree); free(xcall); return rc;