]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: ams-delta.c: use component after check
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 27 Oct 2023 00:09:56 +0000 (00:09 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:08:24 +0000 (11:08 +0100)
commit8890d4d5f25edb4f279598470253fef7ff9f2d6f
tree20d742926c42e502e1f8d8bfe5f1607e4fc32d1f
parenta2ae48bd82eef5e87da59b38df6b3745363d758a
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>
sound/soc/ti/ams-delta.c