Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d644704 authored by Jhansi Konathala's avatar Jhansi Konathala Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarAjit Pandey <ajitp@codeaurora.org>
Signed-off-by: default avatarJhansi Konathala <cjkonat@codeaurora.org>
parent 80cdbd88
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -3519,8 +3519,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];
@@ -3528,14 +3527,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);