st-hal: Decrement num_reg_sm if pcm device is freed
As a part of handle_audio_concurrency(), ape_reg_sm() is called.
For Multi SVA support, num_reg_sm will be incremented.While
ape_reg_sm() is processing if SSR is triggered after incrementing
num_reg_sm, the subsequent calls will be failed leading to freeing
of PCM device opened. Later SSR thread will call ape_dereg_sm(),
which will find PCM device as closed and will return without
decrementing num_reg_sm. For subsequent calls to ape_reg_sm() will
not open PCM device assuming its opened already in case of multi
SVA support.Hence decrement num_reg_sm in case of ape_reg_sm() failures.
Change-Id: I297014b2024122d7ce3d855b7d3bd176d6b7e950
1 file changed