mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 08:44:21 +08:00
ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error
[ Upstream commit 1df793d479
]
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>
This commit is contained in:
parent
44975751be
commit
269be8b290
@ -34,7 +34,7 @@ static int rt711_sdca_index_write(struct rt711_sdca_priv *rt711,
|
||||
|
||||
ret = regmap_write(regmap, addr, value);
|
||||
if (ret < 0)
|
||||
dev_err(rt711->component->dev,
|
||||
dev_err(&rt711->slave->dev,
|
||||
"Failed to set private value: %06x <= %04x ret=%d\n",
|
||||
addr, value, ret);
|
||||
|
||||
@ -50,7 +50,7 @@ static int rt711_sdca_index_read(struct rt711_sdca_priv *rt711,
|
||||
|
||||
ret = regmap_read(regmap, addr, value);
|
||||
if (ret < 0)
|
||||
dev_err(rt711->component->dev,
|
||||
dev_err(&rt711->slave->dev,
|
||||
"Failed to get private value: %06x => %04x ret=%d\n",
|
||||
addr, *value, ret);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user