aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBandan Das <bsd@redhat.com>2015-11-23 16:37:03 -0500
committerGerd Hoffmann <kraxel@redhat.com>2015-12-15 09:25:27 +0100
commitb3c4d4250f571c2c739699be563f764eae1e6f52 (patch)
tree495cb3f7c0f36217c78251353583e11be4ed5c7d
parent4c7a67f5cdc79ed3f91a15e869c8dd653efa19b4 (diff)
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 <bsd@redhat.com> Message-id: 1448314625-3855-3-git-send-email-bsd@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--hw/usb/dev-mtp.c1
1 files changed, 1 insertions, 0 deletions
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;