mirror of
https://github.com/torvalds/linux.git
synced 2026-07-30 19:21:28 +02:00
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: Fenglin Wu <fenglinw@codeaurora.org>
This commit is contained in:
parent
883ca13501
commit
19b7ad347f
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user