mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
asoc: compress: race condition handling in stream cmd put function
protect driver data using mutex lock available to protect against race condtion due to multiple thread access. Change-Id: I7dbff3448958b1700ecca2a090fcb915d5809f30 (cherry picked from commit a9530af1782911e76fa765fd9db7c1ad20710f1d)
This commit is contained in:
parent
469e600330
commit
ad1e75a8ed
1 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -4219,6 +4220,7 @@ static int msm_compr_adsp_stream_cmd_put(struct snd_kcontrol *kcontrol,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
mutex_lock(&pdata->lock);
|
||||
cstream = pdata->cstream[fe_id];
|
||||
if (cstream == NULL) {
|
||||
pr_err("%s cstream is null\n", __func__);
|
||||
|
|
@ -4231,7 +4233,6 @@ static int msm_compr_adsp_stream_cmd_put(struct snd_kcontrol *kcontrol,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
mutex_lock(&pdata->lock);
|
||||
if (prtd->audio_client == NULL) {
|
||||
pr_err("%s: audio_client is null\n", __func__);
|
||||
ret = -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue