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

Commit 6767d8e7 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "coresight: fix unsigned integer calculation overflow"

parents 4801365b 7b3724e6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 *
 * Description: CoreSight Trace Memory Controller driver
 */
@@ -328,7 +328,8 @@ static int usb_transfer_small_packet(struct qdss_request *usb_req,
	w_offset = tmc_sg_get_rwp_offset(tmcdrvdata);
	req_size = ((w_offset < drvdata->offset) ? etr_buf->size : 0) +
				w_offset - drvdata->offset;
	req_size = (req_size < USB_BLK_SIZE) ? req_size : USB_BLK_SIZE;
	req_size = ((req_size + *small_size) < USB_BLK_SIZE) ? req_size :
		(USB_BLK_SIZE - *small_size);

	while (req_size > 0) {