Skip to content

Commit 98d919d

Browse files
vijendarmukundabroonie
authored andcommitted
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: 088a409 ("ASoC: amd: acp: add pm ops support for acp pci driver") Signed-off-by: Vijendar Mukunda <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 60ff540 commit 98d919d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,12 @@ static int __maybe_unused snd_acp_resume(struct device *dev)
199199
ret = acp_init(chip);
200200
if (ret)
201201
dev_err(dev, "ACP init failed\n");
202-
child = chip->chip_pdev->dev;
203-
adata = dev_get_drvdata(&child);
204-
if (adata)
205-
acp_enable_interrupts(adata);
202+
if (chip->chip_pdev) {
203+
child = chip->chip_pdev->dev;
204+
adata = dev_get_drvdata(&child);
205+
if (adata)
206+
acp_enable_interrupts(adata);
207+
}
206208
return ret;
207209
}
208210

0 commit comments

Comments
 (0)