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

Commit 832ce887 authored by Tatenda Chipeperekwa's avatar Tatenda Chipeperekwa Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/dp: release the audio ops lock for failure cases



Release the audio ops lock if there is a failure during audio
info setup. This ensures that subsequent function calls can
successfully acquire the lock, and therefore prevents deadlock
from happening.

Change-Id: Id00342e1ee107b3d77276d8315cd25a211128f5e
Signed-off-by: default avatarTatenda Chipeperekwa <tatendac@codeaurora.org>
parent 0db88144
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -413,7 +413,7 @@ static int dp_audio_info_setup(struct platform_device *pdev,
	audio = dp_audio_get_data(pdev);
	if (IS_ERR(audio)) {
		rc = PTR_ERR(audio);
		goto end;
		return rc;
	}

	mutex_lock(&audio->dp_audio.ops_lock);
@@ -423,7 +423,8 @@ static int dp_audio_info_setup(struct platform_device *pdev,
	if (audio->panel->stream_id >= DP_STREAM_MAX) {
		pr_err("invalid stream id: %d\n", audio->panel->stream_id);
		rc = -EINVAL;
		goto end;
		mutex_unlock(&audio->dp_audio.ops_lock);
		return rc;
	}

	dp_audio_setup_sdp(audio);
@@ -432,7 +433,6 @@ static int dp_audio_info_setup(struct platform_device *pdev,
	dp_audio_enable(audio, true);

	mutex_unlock(&audio->dp_audio.ops_lock);
end:
	return rc;
}