Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b807edb authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: gadget: f_mtp: Update header length correctly in send_file_work"

parents f1c07ca8 6cc6e0e1
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -860,6 +860,14 @@ static void send_file_work(struct work_struct *data)
		if (hdr_size) {
			/* prepend MTP data header */
			header = (struct mtp_data_header *)req->buf;
			/*
			 * Set length as 0xffffffff, if it is greater than
			 * 0xffffffff. Otherwise host will throw error, if file
			 * size greater than 0xffffffff being transferred.
			 */
			if (count > 0xffffffffLL)
				header->length = 0xffffffff;
			else
				header->length = __cpu_to_le32(count);
			header->type = __cpu_to_le16(2); /* data packet */
			header->command = __cpu_to_le16(dev->xfer_command);