diff mbox series

[1/8] ASoC: amd: acp: add a null check for chip_pdev structure

Message ID 20240617072844.871468-1-Vijendar.Mukunda@amd.com
State New
Headers show
Series [1/8] ASoC: amd: acp: add a null check for chip_pdev structure | expand

Commit Message

Vijendar Mukunda June 17, 2024, 7:28 a.m. UTC
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: 088a40980efb ("ASoC: amd: acp: add pm ops support for acp pci driver")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 sound/soc/amd/acp/acp-pci.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Mark Brown June 20, 2024, 11:47 a.m. UTC | #1
On Mon, 17 Jun 2024 12:58:34 +0530, Vijendar Mukunda wrote:
> 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.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/8] ASoC: amd: acp: add a null check for chip_pdev structure
      commit: 98d919dfee1cc402ca29d45da642852d7c9a2301
[2/8] ASoC: amd: acp: remove i2s configuration check in acp_i2s_probe()
      commit: 70fa3900c3ed92158628710e81d274e5cb52f92b
[3/8] ASoC: amd: acp: move chip->flag variable assignment
      commit: 379bcd2c9197bf2c429434e8a01cea0ee1852316

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Mark Brown June 23, 2024, 10:50 a.m. UTC | #2
On Mon, 17 Jun 2024 12:58:34 +0530, Vijendar Mukunda wrote:
> 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.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[4/8] ASoC: amd: acp: remove acp_i2s_probe function
      commit: 75a08ec8c3a6aef914235c409a99046a3d29d1d4
[5/8] ASoC: amd: acp: remove unused variables from acp_resource structure
      commit: 50f1670145392398f4f2ffe9abe4599c86d11ec2
[6/8] ASoC: amd: acp: modify conditional check for programming i2s mclk
      commit: 5b162f60e7e051624e187e45b0fdc481c3573f17
[7/8] ASoC: amd: acp: move i2s clock generation sequence
      commit: d85695b01cbb2455a2f70528bb9e53f2463a39cf
[8/8] ASoC: amd: acp: add pcm constraints for buffer size and period size
      commit: 8978e1f7bc26655e0373c4a6b31e17fcdd497329

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c
index ad320b29e87d..aa3e72d13451 100644
--- a/sound/soc/amd/acp/acp-pci.c
+++ b/sound/soc/amd/acp/acp-pci.c
@@ -199,10 +199,12 @@  static int __maybe_unused snd_acp_resume(struct device *dev)
 	ret = acp_init(chip);
 	if (ret)
 		dev_err(dev, "ACP init failed\n");
-	child = chip->chip_pdev->dev;
-	adata = dev_get_drvdata(&child);
-	if (adata)
-		acp_enable_interrupts(adata);
+	if (chip->chip_pdev) {
+		child = chip->chip_pdev->dev;
+		adata = dev_get_drvdata(&child);
+		if (adata)
+			acp_enable_interrupts(adata);
+	}
 	return ret;
 }