From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Shuming Fan <shumingf@realtek.com>,
Mark Brown <broonie@kernel.org>, Sasha Levin <sashal@kernel.org>,
oder_chiou@realtek.com, lgirdwood@gmail.com, perex@perex.cz,
tiwai@suse.com, alsa-devel@alsa-project.org
Subject: [PATCH AUTOSEL 5.18 20/41] ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error
Date: Thu, 14 Jul 2022 00:22:00 -0400 [thread overview]
Message-ID: <20220714042221.281187-20-sashal@kernel.org> (raw)
In-Reply-To: <20220714042221.281187-1-sashal@kernel.org>
From: Shuming Fan <shumingf@realtek.com>
[ 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 | 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 d8821d535a24..ac75d8a2c9fe 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.35.1
next prev parent reply other threads:[~2022-07-14 4:25 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 4:21 [PATCH AUTOSEL 5.18 01/41] ASoC: ops: Fix off by one in range control validation Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 02/41] pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux() Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 03/41] ASoC: Realtek/Maxim SoundWire codecs: disable pm_runtime on remove Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 04/41] ASoC: rt711-sdca-sdw: fix calibrate mutex initialization Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 05/41] ASoC: Intel: sof_sdw: handle errors on card registration Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 06/41] ASoC: rt711: fix calibrate mutex initialization Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 07/41] ASoC: rt7*-sdw: harden jack_detect_handler Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 08/41] ASoC: codecs: rt700/rt711/rt711-sdca: initialize workqueues in probe Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 09/41] ASoC: SOF: Intel: hda-dsp: Expose hda_dsp_core_power_up() Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 10/41] ASoC: SOF: Intel: hda-loader: Make sure that the fw load sequence is followed Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 11/41] ASoC: SOF: Intel: hda-loader: Clarify the cl_dsp_init() flow Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 12/41] ASoC: wcd9335: Remove RX channel from old list before adding it to a new one Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 13/41] ASoC: wcd9335: Fix spurious event generation Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 14/41] ASoC: wcd938x: Fix event generation for some controls Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 15/41] ASoC: Intel: bytcr_wm5102: Fix GPIO related probe-ordering problem Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 16/41] ASoC: rockchip: i2s: switch BCLK to GPIO Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 17/41] ASoC: wm_adsp: Fix event for preloader Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 18/41] ASoC: wm5110: Fix DRE control Sasha Levin
2022-07-14 4:21 ` [PATCH AUTOSEL 5.18 19/41] ASoC: cs35l41: Correct some control names Sasha Levin
2022-07-14 4:22 ` Sasha Levin [this message]
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 21/41] ASoC: dapm: Initialise kcontrol data for mux/demux controls Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 22/41] ASoC: cs35l41: Add ASP TX3/4 source to register patch Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 23/41] ASoC: cs47l15: Fix event generation for low power mux control Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 24/41] ASoC: madera: Fix event generation for OUT1 demux Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 25/41] ASoC: madera: Fix event generation for rate controls Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 26/41] irqchip: or1k-pic: Undefine mask_ack for level triggered hardware Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 27/41] pinctrl: imx: Add the zero base flag for imx93 Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 28/41] x86/xen: Use clear_bss() for Xen PV guests Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 29/41] x86: Clear .brk area at early boot Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 30/41] soc: ixp4xx/npe: Fix unused match warning Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 31/41] ARM: dts: stm32: use the correct clock source for CEC on stm32mp151 Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 32/41] Revert "can: xilinx_can: Limit CANFD brp to 2" Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 33/41] ALSA: usb-audio: Add quirks for MacroSilicon MS2100/MS2106 devices Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 34/41] ALSA: usb-audio: Add quirk for Fiero SC-01 Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 35/41] ALSA: usb-audio: Add quirk for Fiero SC-01 (fw v1.0.0) Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 36/41] nvme-pci: phison e16 has bogus namespace ids Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 37/41] nvme: use struct group for generic command dwords Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 38/41] wireguard: selftests: set fake real time in init Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 39/41] wireguard: selftests: use virt machine on m68k Sasha Levin
2022-07-14 7:08 ` Geert Uytterhoeven
2022-07-17 23:01 ` Sasha Levin
2022-07-18 1:34 ` Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 40/41] wireguard: selftests: always call kernel makefile Sasha Levin
2022-07-14 4:22 ` [PATCH AUTOSEL 5.18 41/41] signal handling: don't use BUG_ON() for debugging Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220714042221.281187-20-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oder_chiou@realtek.com \
--cc=perex@perex.cz \
--cc=shumingf@realtek.com \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).