From: Bandan Das Date: Mon, 15 Apr 2019 16:47:12 +0000 (-0400) Subject: usb-mtp: change default to success for usb_mtp_update_object X-Git-Tag: v4.1.0-rc0~132^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=83c44b44d406326117ca2f040bae8d7de97b9c8e;p=thirdparty%2Fqemu.git usb-mtp: change default to success for usb_mtp_update_object 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 Message-id: jpgwojv9pwv.fsf@linux.bootlegged.copy Signed-off-by: Gerd Hoffmann --- diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 963449ec7de..d90b336d53f 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -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));