From b3c4d4250f571c2c739699be563f764eae1e6f52 Mon Sep 17 00:00:00 2001 From: Bandan Das Date: Mon, 23 Nov 2015 16:37:03 -0500 Subject: [PATCH] usb-mtp: free objects on a mtp reset On a reset, call usb_mtp_object_free on all objects and their children Signed-off-by: Bandan Das Message-id: 1448314625-3855-3-git-send-email-bsd@redhat.com Signed-off-by: Gerd Hoffmann --- 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 10b657dabb..5b71691753 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -908,6 +908,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;