From patchwork Fri Oct 19 05:20:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10648677 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 04B2D14E2 for ; Fri, 19 Oct 2018 05:27:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFE6F28A3D for ; Fri, 19 Oct 2018 05:27:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2FD728B54; Fri, 19 Oct 2018 05:27:00 +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.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8A25228A3D for ; Fri, 19 Oct 2018 05:27:00 +0000 (UTC) Received: from localhost ([::1]:47078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDNJL-00010X-MF for patchwork-qemu-devel@patchwork.kernel.org; Fri, 19 Oct 2018 01:26:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDNDJ-0003qF-SZ for qemu-devel@nongnu.org; Fri, 19 Oct 2018 01:20:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDNDH-0000QJ-O3 for qemu-devel@nongnu.org; Fri, 19 Oct 2018 01:20:45 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:36527) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDNDH-0000NT-En for qemu-devel@nongnu.org; Fri, 19 Oct 2018 01:20:43 -0400 Received: by mail-pl1-x641.google.com with SMTP id y11-v6so15349089plt.3 for ; Thu, 18 Oct 2018 22:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LbLynbA5qgE9ZN0X4/1tR62dpBQQE/RPx/rLsDwpskA=; b=ac98Hi3Zoo7KcCJcxeTLsn/ZEU0ABHIZTJL4ASY9xOh7IkyNQj1LP5qaCmnrzkZbwi lNHYJtAHxh0uaQ6q4y2RVRtDeLK/iM/hv8tZCuognxN8pGe+SaRy9fo23zZ5eVjxZn2+ xrBO29my2qS/Mryzm66Ly3jdJbwrKbF5YuXTh8DEvvdMKHf07/wCZgV77rwn+NneZiYD UANn1C+tig7hQsp3Kg5Tniah1FzrNA4Oh5gK4WB2zj9Msb7wWWtK/61rmX2Kz/JrO2DD gYpuygMN31lj4hbcsUc7NHtQ439vNYzkkRkVC0A/+ISH+3A34VzdyFw90dRkr1Jw90WL 122A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LbLynbA5qgE9ZN0X4/1tR62dpBQQE/RPx/rLsDwpskA=; b=C15et/h146FrRE/B9jv6ZQcqlKTHmCIHPuQg62YYPJWCs2FlcbxmRtZ/Q6JmZPqUC2 GaJBizqEfIkR2Htd4VsUv5e4Gwor1Kn4i2+JOPpM6CnXG/5njnBCJfWIVI83lfiv8muz 9i6XX7Im8/3I7GZQESQAciABGY5HbbPDIvahUgrdtSqi5h6cvxaG8Fwb65Tpdbb5qlZn QEMiN9CSogAV7FhgxAs3nVMuRo3cVZYQZtU5liZ9YXdagKW88/Za/PmEWhizDnmnH/8A IWsSlIxHWRYSnkqrpZhGR3Hg6eAP8qs/haLVm2V7czyi/Xa1BwH79bxQb6Mv0bfMYW3k aADQ== X-Gm-Message-State: ABuFfoiHCmdxFR9Tj733WgtonyWlZ5QeGZyqpODs05eAXADFQ7Dd15XN HkWqVGuGRZz7wpON6Yr7iqAny9IG X-Google-Smtp-Source: ACcGV609MhAwWCbflD9weMhH8BOgG/7r9l6DN32k++wShkcJR4HSP3LXxu7VLWgJkgfkxuDa4Wt20g== X-Received: by 2002:a17:902:e01:: with SMTP id 1-v6mr27696714plw.207.1539926442548; Thu, 18 Oct 2018 22:20:42 -0700 (PDT) Received: from localhost.localdomain.localdomain ([103.65.40.100]) by smtp.gmail.com with ESMTPSA id p1-v6sm25075191pff.128.2018.10.18.22.20.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Oct 2018 22:20:42 -0700 (PDT) From: Li Qiang To: alex.williamson@redhat.com Date: Thu, 18 Oct 2018 22:20:12 -0700 Message-Id: <1539926412-21831-8-git-send-email-liq3ea@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1539926412-21831-1-git-send-email-liq3ea@gmail.com> References: <1539926412-21831-1-git-send-email-liq3ea@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::641 Subject: [Qemu-devel] [PATCH 7/7] vfio: platform: destory mutex in error path X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Qiang , philmd@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Li Qiang --- hw/vfio/platform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index ba19143..e9d9e80 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -668,7 +668,7 @@ static void vfio_platform_realize(DeviceState *dev, Error **errp) error_setg(errp, "%s", gerr->message); g_error_free(gerr); g_free(path); - return; + goto out; } g_free(path); vdev->compat = contents; @@ -691,6 +691,8 @@ out: return; } + qemu_mutex_destroy(&vdev->intp_mutex); + if (vdev->vbasedev.name) { error_prepend(errp, ERR_PREFIX, vdev->vbasedev.name); } else {