All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error
@ 2022-06-21  9:07 shumingf
  2022-06-21 16:59 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: shumingf @ 2022-06-21  9:07 UTC (permalink / raw)
  To: broonie, lgirdwood
  Cc: oder_chiou, jack.yu, alsa-devel, lars, derek.fang,
	Vijendar.Mukunda, Shuming Fan, flove

From: Shuming Fan <shumingf@realtek.com>

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>
---
 sound/soc/codecs/rt711-sdca.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt711-sdca.c b/sound/soc/codecs/rt711-sdca.c
index 9d226b1cb7e9..925268121901 100644
--- a/sound/soc/codecs/rt711-sdca.c
+++ b/sound/soc/codecs/rt711-sdca.c
@@ -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);
 
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error
  2022-06-21  9:07 [PATCH] ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error shumingf
@ 2022-06-21 16:59 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-06-21 16:59 UTC (permalink / raw)
  To: shumingf, lgirdwood
  Cc: oder_chiou, jack.yu, alsa-devel, lars, derek.fang,
	Vijendar.Mukunda, flove

On Tue, 21 Jun 2022 17:07:19 +0800, shumingf@realtek.com wrote:
> From: Shuming Fan <shumingf@realtek.com>
> 
> 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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error
      commit: f69a10f84cb5ff0b1c6aef0e19e866bbe53ec7ea

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-21 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21  9:07 [PATCH] ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error shumingf
2022-06-21 16:59 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.