Skip to content

Commit b80ab02

Browse files
dbalutagregkh
authored andcommitted
ASoC: amd: acp: Fix possible deadlock
[ Upstream commit 3ff5386 ] On error path, function acp_i2s_set_tdm_slot returns without releasing the lock and this could result in potential deadlocks in the future. Error reported by sparse: sound/soc/amd/acp/acp-i2s.c:95:12: error: context imbalance in 'acp_i2s_set_tdm_slot' - different lock contexts for basic block Fixes: cd60dec ("ASoC: amd: acp: Refactor TDM slots selction based on acp revision id") Signed-off-by: Daniel Baluta <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Bard Liao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 016bc7b commit b80ab02

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sound/soc/amd/acp/acp-i2s.c

+1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ static int acp_i2s_set_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask, u32 rx_mas
181181
break;
182182
default:
183183
dev_err(dev, "Unknown chip revision %d\n", chip->acp_rev);
184+
spin_unlock_irq(&adata->acp_lock);
184185
return -EINVAL;
185186
}
186187
}

0 commit comments

Comments
 (0)