From patchwork Tue Nov 10 22:58:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bandan Das X-Patchwork-Id: 542642 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48C9F1413F8 for ; Wed, 11 Nov 2015 09:59:40 +1100 (AEDT) Received: from localhost ([::1]:36006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwHt4-0007Ah-C5 for incoming@patchwork.ozlabs.org; Tue, 10 Nov 2015 17:59:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwHsW-0006GY-Vf for qemu-devel@nongnu.org; Tue, 10 Nov 2015 17:59:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwHsV-00066k-BO for qemu-devel@nongnu.org; Tue, 10 Nov 2015 17:59:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwHsV-00066S-5x for qemu-devel@nongnu.org; Tue, 10 Nov 2015 17:59:03 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id CD2A8C0A8495 for ; Tue, 10 Nov 2015 22:59:02 +0000 (UTC) Received: from aqua.redhat.com (ovpn-113-187.phx2.redhat.com [10.3.113.187]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAAMwd6X022580; Tue, 10 Nov 2015 17:59:02 -0500 From: Bandan Das To: qemu-devel@nongnu.org Date: Tue, 10 Nov 2015 17:58:17 -0500 Message-Id: <1447196299-16091-3-git-send-email-bsd@redhat.com> In-Reply-To: <1447196299-16091-1-git-send-email-bsd@redhat.com> References: <1447196299-16091-1-git-send-email-bsd@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Bandan Das , kraxel@redhat.com Subject: [Qemu-devel] [PATCH v2 2/4] usb-mtp: free objects on a mtp reset 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 On a reset, call usb_mtp_object_free on all objects and their children Signed-off-by: Bandan Das --- hw/usb/dev-mtp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index eea2dad..c39b81a 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -907,6 +907,7 @@ static void usb_mtp_handle_reset(USBDevice *dev) trace_usb_mtp_reset(s->dev.addr); + usb_mtp_object_free(s, QTAILQ_FIRST(&s->objects)); s->session = 0; usb_mtp_data_free(s->data_in); s->data_in = NULL;