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

Commit 9b308d86 authored by Fenglin Wu's avatar Fenglin Wu
Browse files

input: qcom-hv-haptics: fix out of bound of FIFO samples array



When calculating play length for FIFO play, it is out of bound
of the FIFO samples array. Fix it.

Change-Id: I8ad458802a0070f493ac53160ab90a6cf648d9e7
Signed-off-by: default avatarFenglin Wu <fenglinw@codeaurora.org>
parent 33569a19
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -675,7 +675,7 @@ static int get_fifo_play_length_us(struct fifo_cfg *fifo, u32 t_lra_us)
	if (!fifo)
		return -EINVAL;

	for (i = fifo->num_s; i > 0; i--)
	for (i = fifo->num_s - 1; i > 0; i--)
		if (fifo->samples[i] != 0)
			break;