diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2023-10-27 03:09:56 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-11-20 12:29:19 +0300 |
commit | d059943ddeb733f87d451aba071aca784f5bce11 (patch) | |
tree | 8d972e75428edf31f5cbc3e41eaf2c9c73adbc45 /sound | |
parent | 56a8b3f11e79e461bc363a3a4d4f46e1963fa1f9 (diff) | |
download | linux-d059943ddeb733f87d451aba071aca784f5bce11.tar.xz |
ASoC: ams-delta.c: use component after check
[ Upstream commit bd0f7498bc9084d8cccc5484cd004b40f314b763 ]
static void cx81801_close()
{
...
(A) struct snd_soc_dapm_context *dapm = &component->card->dapm;
...
(B) if (!component)
return;
}
(A) uses component before NULL check (B). This patch moves it after (B).
Fixes: d0fdfe34080c ("ASoC: cx20442: replace codec to component")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/3e608474-e99a-4866-ae98-3054a4221f09@moroto.mountain
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ttqdq623.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/omap/ams-delta.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c index 4dce494dfbd3..ef9fda16ce13 100644 --- a/sound/soc/omap/ams-delta.c +++ b/sound/soc/omap/ams-delta.c @@ -300,7 +300,7 @@ static int cx81801_open(struct tty_struct *tty) static void cx81801_close(struct tty_struct *tty) { struct snd_soc_component *component = tty->disc_data; - struct snd_soc_dapm_context *dapm = &component->card->dapm; + struct snd_soc_dapm_context *dapm; del_timer_sync(&cx81801_timer); @@ -312,6 +312,8 @@ static void cx81801_close(struct tty_struct *tty) v253_ops.close(tty); + dapm = &component->card->dapm; + /* Revert back to default audio input/output constellation */ snd_soc_dapm_mutex_lock(dapm); |