ASoC: amd: acp: Fix NULL pointer deref on acp resume path
authorVenkata Prasad Potturu <venkataprasad.potturu@amd.com>
Fri, 25 Apr 2025 06:01:39 +0000 (11:31 +0530)
committerMark Brown <broonie@kernel.org>
Fri, 25 Apr 2025 12:35:05 +0000 (13:35 +0100)
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: e3933683b25e ("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>
sound/soc/amd/acp/acp-rembrandt.c
sound/soc/amd/acp/acp-renoir.c
sound/soc/amd/acp/acp63.c
sound/soc/amd/acp/acp70.c

index 746b6ed72029652d3e71eaadf200f45f83f01027..cccdd10c345e6dc3491c3850b003b05c713d3c3d 100644 (file)
@@ -199,7 +199,7 @@ static void rembrandt_audio_remove(struct platform_device *pdev)
 
 static int rmb_pcm_resume(struct device *dev)
 {
-       struct acp_chip_info *chip = dev_get_platdata(dev);
+       struct acp_chip_info *chip = dev_get_drvdata(dev->parent);
        struct acp_stream *stream;
        struct snd_pcm_substream *substream;
        snd_pcm_uframes_t buf_in_frames;
index ebf0106fc73742dcee6e6fe403ad07352ef4b729..04f6d70b6a92d8ff964994ed0b3b4dee71d48266 100644 (file)
@@ -146,7 +146,7 @@ static void renoir_audio_remove(struct platform_device *pdev)
 
 static int rn_pcm_resume(struct device *dev)
 {
-       struct acp_chip_info *chip = dev_get_platdata(dev);
+       struct acp_chip_info *chip = dev_get_drvdata(dev->parent);
        struct acp_stream *stream;
        struct snd_pcm_substream *substream;
        snd_pcm_uframes_t buf_in_frames;
index 52d895e624c723964eaf87b00382908db162261e..1f15c96a9b9461ee245f19cd147b865c46f79cf4 100644 (file)
@@ -250,7 +250,7 @@ static void acp63_audio_remove(struct platform_device *pdev)
 
 static int acp63_pcm_resume(struct device *dev)
 {
-       struct acp_chip_info *chip = dev_get_platdata(dev);
+       struct acp_chip_info *chip = dev_get_drvdata(dev->parent);
        struct acp_stream *stream;
        struct snd_pcm_substream *substream;
        snd_pcm_uframes_t buf_in_frames;
index 6d5f5ade075c878f1910e3e8939537c341084ca1..217b717e9beb75e18bc7989c08871a2477fa11bf 100644 (file)
@@ -182,7 +182,7 @@ static void acp_acp70_audio_remove(struct platform_device *pdev)
 
 static int acp70_pcm_resume(struct device *dev)
 {
-       struct acp_chip_info *chip = dev_get_platdata(dev);
+       struct acp_chip_info *chip = dev_get_drvdata(dev->parent);
        struct acp_stream *stream;
        struct snd_pcm_substream *substream;
        snd_pcm_uframes_t buf_in_frames;