Merge "msm: sps: avoid accessing resources released by pipe disconnect"

This commit is contained in:
Linux Build Service Account 2015-06-16 22:54:57 -07:00 committed by Gerrit - the friendly Code Review server
commit e17e3ab88f
1 changed files with 4 additions and 4 deletions

View File

@ -1326,6 +1326,7 @@ int sps_connect(struct sps_pipe *h, struct sps_connect *connect)
goto exit_err;
}
mutex_lock(&bam->lock);
SPS_DBG2("sps:sps_connect: bam %pa src 0x%lx dest 0x%lx mode %s",
BAM_ID(bam),
connect->source,
@ -1334,14 +1335,13 @@ int sps_connect(struct sps_pipe *h, struct sps_connect *connect)
/* Allocate resources for the specified connection */
pipe->connect = *connect;
mutex_lock(&bam->lock);
result = sps_rm_state_change(pipe, SPS_STATE_ALLOCATE);
mutex_unlock(&bam->lock);
if (result)
if (result) {
mutex_unlock(&bam->lock);
goto exit_err;
}
/* Configure the connection */
mutex_lock(&bam->lock);
result = sps_rm_state_change(pipe, SPS_STATE_CONNECT);
mutex_unlock(&bam->lock);
if (result) {