Merge "ASoC: APR: Fix missing APR deregister from asm"

This commit is contained in:
Linux Build Service Account 2017-05-26 06:31:12 -07:00 committed by Gerrit - the friendly Code Review server
commit 33a94f46e5
2 changed files with 8 additions and 9 deletions

View file

@ -745,13 +745,14 @@ int apr_deregister(void *handle)
if (!handle)
return -EINVAL;
mutex_lock(&svc->m_lock);
if (!svc->svc_cnt) {
pr_err("%s: svc already deregistered. svc = %pK\n",
__func__, svc);
mutex_unlock(&svc->m_lock);
return -EINVAL;
}
mutex_lock(&svc->m_lock);
dest_id = svc->dest_id;
client_id = svc->client_id;
clnt = &client[dest_id][client_id];

View file

@ -1038,14 +1038,12 @@ void q6asm_audio_client_free(struct audio_client *ac)
}
rtac_set_asm_handle(ac->session, NULL);
if (!atomic_read(&ac->reset)) {
apr_deregister(ac->apr2);
apr_deregister(ac->apr);
q6asm_mmap_apr_dereg();
ac->apr2 = NULL;
ac->apr = NULL;
ac->mmap_apr = NULL;
}
apr_deregister(ac->apr2);
apr_deregister(ac->apr);
q6asm_mmap_apr_dereg();
ac->apr2 = NULL;
ac->apr = NULL;
ac->mmap_apr = NULL;
q6asm_session_free(ac);
pr_debug("%s: APR De-Register\n", __func__);