msm: audio: qdsp6v2: Fix crash with erroneous aac playback
Impact:
Crash with back to back playback of erroneous aac clips
Problem:
There are two if condition to check whether input buffer is eos or not
while adding input buffer to write
It evaluates the first condition for non eos and if it is true
it calls q6 cmd to write input buffer
In a very rare case before evaluation of second condition driver gets
the WRITE DONE EVENT for same input buffer and it frees the buffer
while acknowledging the WRITE DONE event
As buffer has already been freed second if condition evaluates true
and it tries to free the same buffer that leads to a crash
Change:
As both the if condition can not be true for same input buffer
replace second if condition with else if
Change-Id: I28f2bdae322c1f2044ca1c13c445c38bd4823197
CRs-Fixed: 314588
Signed-off-by: Preetam Singh Ranawat <apranawat@codeaurora.org>
1 file changed