Skip to content

Commit ba85883

Browse files
Venkata-Prasad-Potturubroonie
authored andcommitted
ASoC: amd: acp: Fix NULL pointer deref on acp resume path
update chip data using dev_get_drvdata(dev->parent) instead of dev_get_platdata(dev). BUG: kernel NULL pointer dereference, address: 0000000000000010 Call Trace: <TASK> ? __pfx_platform_pm_resume+0x10/0x10 platform_pm_resume+0x28/0x60 dpm_run_callback+0x51/0x1a0 device_resume+0x1a6/0x2b0 dpm_resume+0x168/0x230 Fixes: e393368 ("ASoC: amd: acp: Remove redundant acp_dev_data structure") Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://patch.msgid.link/20250425060144.1773265-1-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent c1b0f51 commit ba85883

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

sound/soc/amd/acp/acp-rembrandt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static void rembrandt_audio_remove(struct platform_device *pdev)
199199

200200
static int rmb_pcm_resume(struct device *dev)
201201
{
202-
struct acp_chip_info *chip = dev_get_platdata(dev);
202+
struct acp_chip_info *chip = dev_get_drvdata(dev->parent);
203203
struct acp_stream *stream;
204204
struct snd_pcm_substream *substream;
205205
snd_pcm_uframes_t buf_in_frames;

sound/soc/amd/acp/acp-renoir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static void renoir_audio_remove(struct platform_device *pdev)
146146

147147
static int rn_pcm_resume(struct device *dev)
148148
{
149-
struct acp_chip_info *chip = dev_get_platdata(dev);
149+
struct acp_chip_info *chip = dev_get_drvdata(dev->parent);
150150
struct acp_stream *stream;
151151
struct snd_pcm_substream *substream;
152152
snd_pcm_uframes_t buf_in_frames;

sound/soc/amd/acp/acp63.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static void acp63_audio_remove(struct platform_device *pdev)
250250

251251
static int acp63_pcm_resume(struct device *dev)
252252
{
253-
struct acp_chip_info *chip = dev_get_platdata(dev);
253+
struct acp_chip_info *chip = dev_get_drvdata(dev->parent);
254254
struct acp_stream *stream;
255255
struct snd_pcm_substream *substream;
256256
snd_pcm_uframes_t buf_in_frames;

sound/soc/amd/acp/acp70.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static void acp_acp70_audio_remove(struct platform_device *pdev)
182182

183183
static int acp70_pcm_resume(struct device *dev)
184184
{
185-
struct acp_chip_info *chip = dev_get_platdata(dev);
185+
struct acp_chip_info *chip = dev_get_drvdata(dev->parent);
186186
struct acp_stream *stream;
187187
struct snd_pcm_substream *substream;
188188
snd_pcm_uframes_t buf_in_frames;

0 commit comments

Comments
 (0)