summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAjit Pandey <ajitp@codeaurora.org>2019-10-24 13:45:11 +0530
committerAjit Pandey <ajitp@codeaurora.org>2019-12-17 13:29:23 +0530
commit60ac595c7424e341bfbbe714ba25a0b56fbd8e2c (patch)
treed1e86727791a7a57330f73ea4c29f96b4e0fb04a
parenta3640c08ea9cd079d2781f5bf2205215ff121abd (diff)
downloadmsm-extra-60ac595c7424e341bfbbe714ba25a0b56fbd8e2c.tar.gz
asoc: msm-compress: Replace goto with return in case of invalid value
In case of invalid values in _put() callback return directly to avoid deadlock issue with mutex unlocking in goto label. Change-Id: Ib0623e26dd83b96cd6ec315f515098b8ea0b2dd2 Signed-off-by: Ajit Pandey <ajitp@codeaurora.org>
-rw-r--r--asoc/msm-compress-q6-v2.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/asoc/msm-compress-q6-v2.c b/asoc/msm-compress-q6-v2.c
index b96d3b49..1d0fd2eb 100644
--- a/asoc/msm-compress-q6-v2.c
+++ b/asoc/msm-compress-q6-v2.c
@@ -3518,8 +3518,7 @@ static int msm_compr_dec_params_put(struct snd_kcontrol *kcontrol,
if (fe_id >= MSM_FRONTEND_DAI_MAX) {
pr_err("%s Received out of bounds fe_id %lu\n",
__func__, fe_id);
- rc = -EINVAL;
- goto end;
+ return -EINVAL;
}
cstream = pdata->cstream[fe_id];
@@ -3527,14 +3526,12 @@ static int msm_compr_dec_params_put(struct snd_kcontrol *kcontrol,
if (!cstream || !dec_params) {
pr_err("%s: stream or dec_params inactive\n", __func__);
- rc = -EINVAL;
- goto end;
+ return -EINVAL;
}
prtd = cstream->runtime->private_data;
if (!prtd) {
pr_err("%s: cannot set dec_params\n", __func__);
- rc = -EINVAL;
- goto end;
+ return -EINVAL;
}
mutex_lock(&pdata->lock);
@@ -3776,22 +3773,19 @@ static int msm_compr_adsp_stream_cmd_put(struct snd_kcontrol *kcontrol,
if (fe_id >= MSM_FRONTEND_DAI_MAX) {
pr_err("%s Received invalid fe_id %lu\n",
__func__, fe_id);
- ret = -EINVAL;
- goto done;
+ return -EINVAL;
}
cstream = pdata->cstream[fe_id];
if (cstream == NULL) {
pr_err("%s cstream is null\n", __func__);
- ret = -EINVAL;
- goto done;
+ return -EINVAL;
}
prtd = cstream->runtime->private_data;
if (!prtd) {
pr_err("%s: prtd is null\n", __func__);
- ret = -EINVAL;
- goto done;
+ return -EINVAL;
}
mutex_lock(&pdata->lock);
@@ -3842,22 +3836,19 @@ static int msm_compr_ion_fd_map_put(struct snd_kcontrol *kcontrol,
if (fe_id >= MSM_FRONTEND_DAI_MAX) {
pr_err("%s Received out of bounds invalid fe_id %lu\n",
__func__, fe_id);
- ret = -EINVAL;
- goto done;
+ return -EINVAL;
}
cstream = pdata->cstream[fe_id];
if (cstream == NULL) {
pr_err("%s cstream is null\n", __func__);
- ret = -EINVAL;
- goto done;
+ return -EINVAL;
}
prtd = cstream->runtime->private_data;
if (!prtd) {
pr_err("%s: prtd is null\n", __func__);
- ret = -EINVAL;
- goto done;
+ return -EINVAL;
}
mutex_lock(&pdata->lock);
@@ -3891,8 +3882,7 @@ static int msm_compr_rtic_event_ack_put(struct snd_kcontrol *kcontrol,
if (fe_id >= MSM_FRONTEND_DAI_MAX) {
pr_err("%s Received invalid fe_id %lu\n",
__func__, fe_id);
- ret = -EINVAL;
- goto done;
+ return -EINVAL;
}
mutex_lock(&pdata->lock);