]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
usb-mtp: change default to success for usb_mtp_update_object
authorBandan Das <bsd@redhat.com>
Mon, 15 Apr 2019 16:47:12 +0000 (12:47 -0400)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 2 May 2019 06:29:33 +0000 (08:29 +0200)
Commit c5ead51f90cf (usb-mtp: return incomplete transfer on a lstat
failure) checks if lstat succeeded when updating attributes of a
file. However, it also changed behavior to return an error by
default. This is incorrect because for smaller file sizes, Qemu
will attempt to write the file in one go and there won't be
an object for it.

Fixes: c5ead51f90cf
Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: jpgwojv9pwv.fsf@linux.bootlegged.copy
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/dev-mtp.c

index 963449ec7de8748e76440103ffdf0c503cd8caea..d90b336d53f42b0f16dcacb5001333b79768035a 100644 (file)
@@ -1587,7 +1587,7 @@ done:
 
 static int usb_mtp_update_object(MTPObject *parent, char *name)
 {
-    int ret = -1;
+    int ret = 0;
 
     MTPObject *o =
         usb_mtp_object_lookup_name(parent, name, strlen(name));