Skip to content

Commit 1df793d

Browse files
shumingfanbroonie
authored andcommitted
ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c6a5f22 commit 1df793d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/soc/codecs/rt711-sdca.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static int rt711_sdca_index_write(struct rt711_sdca_priv *rt711,
3434

3535
ret = regmap_write(regmap, addr, value);
3636
if (ret < 0)
37-
dev_err(rt711->component->dev,
37+
dev_err(&rt711->slave->dev,
3838
"Failed to set private value: %06x <= %04x ret=%d\n",
3939
addr, value, ret);
4040

@@ -50,7 +50,7 @@ static int rt711_sdca_index_read(struct rt711_sdca_priv *rt711,
5050

5151
ret = regmap_read(regmap, addr, value);
5252
if (ret < 0)
53-
dev_err(rt711->component->dev,
53+
dev_err(&rt711->slave->dev,
5454
"Failed to get private value: %06x => %04x ret=%d\n",
5555
addr, *value, ret);
5656

0 commit comments

Comments
 (0)