diff options
author | Arnaud Pouliquen <arnaud.pouliquen@st.com> | 2017-03-28 15:04:55 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-04-06 20:29:07 +0200 |
commit | d05d862ead8eca5e7d4ccf82d39d9189579ee5b1 (patch) | |
tree | df3ed6ade1621328947ef5f94e3d553aa73b9d58 /sound/soc/sti/uniperif.h | |
parent | ASoC: STI: Fix reader substream pointer set (diff) | |
download | linux-d05d862ead8eca5e7d4ccf82d39d9189579ee5b1.tar.xz linux-d05d862ead8eca5e7d4ccf82d39d9189579ee5b1.zip |
ASoC: STI: Fix null ptr deference in IRQ handler
With RTlinux a race condition has been found that leads to NULL ptr crash:
- On CPU 0: uni_player_irq_handler is called to treat XRUN
"(player->state == UNIPERIF_STATE_STOPPED)" is FALSE so status is checked,
dev_err(player->dev, "FIFO underflow error detected") is printed
and then snd_pcm_stream_lock should be called to lock stream for stopping.
- On CPU 1: application stop and close the stream.
Issue is that the stop and shutdown functions are executed while
"FIFO underflow error detected" is printed.
So when CPU 0 calls snd_pcm_stream_lock, player->substream is already null.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sti/uniperif.h')
-rw-r--r-- | sound/soc/sti/uniperif.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/sti/uniperif.h b/sound/soc/sti/uniperif.h index d487dd2ef016..cfcb0ea9d99d 100644 --- a/sound/soc/sti/uniperif.h +++ b/sound/soc/sti/uniperif.h @@ -1299,6 +1299,7 @@ struct uniperif { int ver; /* IP version, used by register access macros */ struct regmap_field *clk_sel; struct regmap_field *valid_sel; + spinlock_t irq_lock; /* use to prevent race condition with IRQ */ /* capabilities */ const struct snd_pcm_hardware *hw; |