From patchwork Sun Sep 24 21:22:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 9968889 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 38640602B9 for ; Sun, 24 Sep 2017 22:43:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B1CB28BE5 for ; Sun, 24 Sep 2017 22:43:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FEC028BEB; Sun, 24 Sep 2017 22:43:31 +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=-6.9 required=2.0 tests=BAYES_00,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 D779228BE5 for ; Sun, 24 Sep 2017 22:43:30 +0000 (UTC) Received: from localhost ([::1]:39722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwFcY-0002rZ-1f for patchwork-qemu-devel@patchwork.kernel.org; Sun, 24 Sep 2017 18:43:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwFbE-0002pM-0K for qemu-devel@nongnu.org; Sun, 24 Sep 2017 18:42:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwFbA-00082j-3D for qemu-devel@nongnu.org; Sun, 24 Sep 2017 18:42:08 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:58441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwFb9-00081f-Rn; Sun, 24 Sep 2017 18:42:04 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 4136E41C78; Mon, 25 Sep 2017 01:42:00 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 4F570B7B; Mon, 25 Sep 2017 00:22:55 +0300 (MSK) Received: (nullmailer pid 28284 invoked by uid 1000); Sun, 24 Sep 2017 21:22:52 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Mon, 25 Sep 2017 00:22:40 +0300 Message-Id: <42c74252d68714894de4ba6d9c257dcd919e30b0.1506288070.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 22/31] chardev/baum: fix baum that releases brlapi twice 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: Liang Yan , qemu-trivial@nongnu.org, Michael Tokarev Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Liang Yan Error process of baum_chr_open needs to set brlapi null, so it won't get released twice in char_braille_finalize, which will cause "/usr/bin/qemu-system-x86_64: double free or corruption (!prev)" Signed-off-by: Liang Yan Reviewed-by: Marc-André Lureau Signed-off-by: Michael Tokarev --- chardev/baum.c | 1 + 1 file changed, 1 insertion(+) diff --git a/chardev/baum.c b/chardev/baum.c index 302dd9666c..67fd783a59 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -643,6 +643,7 @@ static void baum_chr_open(Chardev *chr, error_setg(errp, "brlapi__openConnection: %s", brlapi_strerror(brlapi_error_location())); g_free(handle); + baum->brlapi = NULL; return; } baum->deferred_init = 0;