ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error
authorShuming Fan <shumingf@realtek.com>
Tue, 21 Jun 2022 09:07:19 +0000 (17:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:39 +0000 (21:24 +0200)
commit269be8b2907378adf72d7347cfa43ef230351a06
tree3b240934f53217112056856dae00d93beec56550
parent44975751bef02e8ec25f4770c8f1c01f92ce892b
ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error

[ Upstream commit 1df793d479bef546569fc2e409ff8bb3f0fb8e99 ]

The initial settings will be written before the codec probe function.
But, the rt711->component doesn't be assigned yet.
If IO error happened during initial settings operations, it will cause the kernel panic.
This patch changed component->dev to slave->dev to fix this issue.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20220621090719.30558-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/rt711-sdca.c