From patchwork Thu Dec 13 10:37:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 205805 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 409552C0097 for ; Thu, 13 Dec 2012 22:19:08 +1100 (EST) Received: from localhost ([::1]:49290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tj6Bv-0001qX-9U for incoming@patchwork.ozlabs.org; Thu, 13 Dec 2012 05:38:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tj6Bg-0001fC-Lq for qemu-devel@nongnu.org; Thu, 13 Dec 2012 05:38:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tj6Bf-0001Sb-Hs for qemu-devel@nongnu.org; Thu, 13 Dec 2012 05:38:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tj6Bf-0001SX-9v for qemu-devel@nongnu.org; Thu, 13 Dec 2012 05:38:43 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBDAcgLo020000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Dec 2012 05:38:42 -0500 Received: from localhost (ovpn-113-39.phx2.redhat.com [10.3.113.39]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qBDAcdwj007985; Thu, 13 Dec 2012 05:38:40 -0500 From: Amit Shah To: Alon Levy Date: Thu, 13 Dec 2012 16:07:56 +0530 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Amit Shah , qemu list Subject: [Qemu-devel] [PATCH 4/4] virtio-serial: delete timer if active during exit 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The post_load timer was being freed, but not deleted. This could cause problems when the timer is armed, but the device is hot-unplugged before the callback is executed. Signed-off-by: Amit Shah --- hw/virtio-serial-bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 09d4659..fc0166c 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -1038,6 +1038,7 @@ void virtio_serial_exit(VirtIODevice *vdev) g_free(vser->ports_map); if (vser->post_load) { g_free(vser->post_load->connected); + qemu_del_timer(vser->post_load->timer); qemu_free_timer(vser->post_load->timer); g_free(vser->post_load); }