qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>, Bandan Das <bsd@redhat.com>
Subject: [Qemu-devel] [PULL 3/5] usb-mtp: reset ObjectInfo dataset size on cleanup
Date: Mon,  1 Oct 2018 11:28:46 +0200	[thread overview]
Message-ID: <20181001092848.11082-4-kraxel@redhat.com> (raw)
In-Reply-To: <20181001092848.11082-1-kraxel@redhat.com>

From: Bandan Das <bsd@redhat.com>

Stale values in this field may result in qemu
expecting more data on the next operation

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 20180907220851.9658-4-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/dev-mtp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 15edf3bb82..00a3691bae 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -1568,6 +1568,7 @@ static void usb_mtp_handle_control(USBDevice *dev, USBPacket *p,
             if (s->write_pending) {
                 g_free(s->dataset.filename);
                 s->write_pending = false;
+                s->dataset.size = 0;
             }
             usb_mtp_data_free(s->data_out);
             s->data_out = NULL;
@@ -1693,6 +1694,7 @@ done:
     }
 free:
     g_free(s->dataset.filename);
+    s->dataset.size = 0;
     g_free(path);
     s->write_pending = false;
 }
-- 
2.9.3

  parent reply	other threads:[~2018-10-01  9:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01  9:28 [Qemu-devel] [PULL 0/5] Usb 20181001 patches Gerd Hoffmann
2018-10-01  9:28 ` [Qemu-devel] [PULL 1/5] usb-mtp: fix error conditions for write operation Gerd Hoffmann
2018-10-01  9:28 ` [Qemu-devel] [PULL 2/5] doc: replace x-root with rootdir for usb-mtp Gerd Hoffmann
2018-10-01  9:28 ` Gerd Hoffmann [this message]
2018-10-01  9:28 ` [Qemu-devel] [PULL 4/5] usb-hub: clear suspend on detach Gerd Hoffmann
2018-10-01  9:28 ` [Qemu-devel] [PULL 5/5] ohci: set effectively usb frame rate to 1kHz Gerd Hoffmann
2018-10-01 14:44 ` [Qemu-devel] [PULL 0/5] Usb 20181001 patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181001092848.11082-4-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=bsd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).