From patchwork Fri Jan 15 15:17:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 8042591 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 94A339F6FA for ; Fri, 15 Jan 2016 15:18:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 944F62044C for ; Fri, 15 Jan 2016 15:18:08 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 019CE20434 for ; Fri, 15 Jan 2016 15:18:08 +0000 (UTC) Received: from localhost ([::1]:47517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK68d-0006h7-4E for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Jan 2016 10:18:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK67d-00059Z-E4 for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:17:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aK67c-0007BK-M4 for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:17:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK67c-0007B2-H3 for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:17:04 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 3ECEB49DCC for ; Fri, 15 Jan 2016 15:17:04 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-70.ams2.redhat.com [10.36.112.70]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0FFH2Yx008891; Fri, 15 Jan 2016 10:17:02 -0500 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 15 Jan 2016 16:17:01 +0100 Message-Id: <1452871021-32405-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] qemu-char: do not leak QemuMutex when freeing a character device 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The leak is only apparent on Win32. On POSIX platforms destroying a mutex is not necessary. Reported-by: Eric Blake Signed-off-by: Paolo Bonzini Reviewed-by: Daniel P. Berrange --- qemu-char.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qemu-char.c b/qemu-char.c index 02b0318..c7b8699 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3967,6 +3967,7 @@ static void qemu_chr_free_common(CharDriverState *chr) if (chr->logfd != -1) { close(chr->logfd); } + qemu_mutex_destroy(&chr->chr_write_lock); g_free(chr); }