dev-mtp: fix buffer allocation for writing file contents
commit406f35d7fcf5f029780d2e0cc9fa0cc37856d57c
authorBandan Das <bsd@redhat.com>
Fri, 20 Jul 2018 21:40:17 +0000 (20 17:40 -0400)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 21 Aug 2018 08:27:59 +0000 (21 10:27 +0200)
tree94d6fabe95c83333be396d718157bc08760db668
parent47bff13cea8dd3e6ae869c3203723d93bd734637
dev-mtp: fix buffer allocation for writing file contents

usb_mtp_realloc() was being incorrectly used when allocating
buffer for incoming data. Set d->length only after resizing
the buffer.

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 20180720214020.22897-3-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/dev-mtp.c