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

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

Merge "soc: qcom: glink: Return error in case of invalid input"

parents 0b2834e3 86c5f5a7
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -483,8 +483,10 @@ static int fifo_read(struct edge_info *einfo, void *_data, int len)
	uint32_t fifo_size = einfo->rx_fifo_size;
	uint32_t n;

	if (read_index >= fifo_size || write_index >= fifo_size)
		return 0;
	if (read_index >= fifo_size || write_index >= fifo_size) {
		WARN_ON_ONCE(1);
		return -EINVAL;
	}
	while (len) {
		ptr = einfo->rx_fifo + read_index;
		if (read_index <= write_index)
@@ -531,8 +533,10 @@ static int fifo_write_body(struct edge_info *einfo, const void *_data,
	uint32_t fifo_size = einfo->tx_fifo_size;
	uint32_t n;

	if (read_index >= fifo_size || *write_index >= fifo_size)
		return 0;
	if (read_index >= fifo_size || *write_index >= fifo_size) {
		WARN_ON_ONCE(1);
		return -EINVAL;
	}
	while (len) {
		ptr = einfo->tx_fifo + *write_index;
		if (*write_index < read_index) {