Commit 98d919df authored by Vijendar Mukunda's avatar Vijendar Mukunda Committed by Mark Brown

ASoC: amd: acp: add a null check for chip_pdev structure

When acp platform device creation is skipped, chip->chip_pdev value will
remain NULL. Add NULL check for chip->chip_pdev structure in
snd_acp_resume() function to avoid null pointer dereference.

Fixes: 088a4098 ("ASoC: amd: acp: add pm ops support for acp pci driver")
Signed-off-by: default avatarVijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://msgid.link/r/20240617072844.871468-1-Vijendar.Mukunda@amd.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 60ff540a
...@@ -199,10 +199,12 @@ static int __maybe_unused snd_acp_resume(struct device *dev) ...@@ -199,10 +199,12 @@ static int __maybe_unused snd_acp_resume(struct device *dev)
ret = acp_init(chip); ret = acp_init(chip);
if (ret) if (ret)
dev_err(dev, "ACP init failed\n"); dev_err(dev, "ACP init failed\n");
child = chip->chip_pdev->dev; if (chip->chip_pdev) {
adata = dev_get_drvdata(&child); child = chip->chip_pdev->dev;
if (adata) adata = dev_get_drvdata(&child);
acp_enable_interrupts(adata); if (adata)
acp_enable_interrupts(adata);
}
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment