linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: sdw_utils: Fix potential NULL pointer deref in is_sdca_endpoint_present()
@ 2025-06-10 10:32 Thorsten Blum
  2025-06-10 12:32 ` Charles Keepax
  2025-06-10 14:16 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2025-06-10 10:32 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Bard Liao, Pierre-Louis Bossart, Vijendar Mukunda,
	Péter Ujfalusi, Charles Keepax, Richard Fitzgerald,
	Peter Zijlstra, Ranjani Sridharan
  Cc: Thorsten Blum, stable, Liam Girdwood, linux-sound, linux-kernel

Check the return value of kzalloc() and exit early to avoid a potential
NULL pointer dereference.

Cc: stable@vger.kernel.org
Fixes: 4f8ef33dd44a ("ASoC: soc_sdw_utils: skip the endpoint that doesn't present")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 sound/soc/sdw_utils/soc_sdw_utils.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c
index 30f84f4e7637..b70cb3793d8f 100644
--- a/sound/soc/sdw_utils/soc_sdw_utils.c
+++ b/sound/soc/sdw_utils/soc_sdw_utils.c
@@ -1180,6 +1180,8 @@ static int is_sdca_endpoint_present(struct device *dev,
 	int i;
 
 	dlc = kzalloc(sizeof(*dlc), GFP_KERNEL);
+	if (!dlc)
+		return -ENOMEM;
 
 	adr_end = &adr_dev->endpoints[end_index];
 	dai_info = &codec_info->dais[adr_end->num];
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: sdw_utils: Fix potential NULL pointer deref in is_sdca_endpoint_present()
  2025-06-10 10:32 [PATCH] ASoC: sdw_utils: Fix potential NULL pointer deref in is_sdca_endpoint_present() Thorsten Blum
@ 2025-06-10 12:32 ` Charles Keepax
  2025-06-10 14:16 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2025-06-10 12:32 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Bard Liao, Pierre-Louis Bossart, Vijendar Mukunda,
	Péter Ujfalusi, Richard Fitzgerald, Peter Zijlstra,
	Ranjani Sridharan, stable, Liam Girdwood, linux-sound,
	linux-kernel

On Tue, Jun 10, 2025 at 12:32:16PM +0200, Thorsten Blum wrote:
> Check the return value of kzalloc() and exit early to avoid a potential
> NULL pointer dereference.
> 
> Cc: stable@vger.kernel.org
> Fixes: 4f8ef33dd44a ("ASoC: soc_sdw_utils: skip the endpoint that doesn't present")
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: sdw_utils: Fix potential NULL pointer deref in is_sdca_endpoint_present()
  2025-06-10 10:32 [PATCH] ASoC: sdw_utils: Fix potential NULL pointer deref in is_sdca_endpoint_present() Thorsten Blum
  2025-06-10 12:32 ` Charles Keepax
@ 2025-06-10 14:16 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-06-10 14:16 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Bard Liao,
	Pierre-Louis Bossart, Vijendar Mukunda, Péter Ujfalusi,
	Charles Keepax, Richard Fitzgerald, Peter Zijlstra,
	Ranjani Sridharan, Thorsten Blum
  Cc: stable, Liam Girdwood, linux-sound, linux-kernel

On Tue, 10 Jun 2025 12:32:16 +0200, Thorsten Blum wrote:
> Check the return value of kzalloc() and exit early to avoid a potential
> NULL pointer dereference.
> 
> 

Applied to

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

Thanks!

[1/1] ASoC: sdw_utils: Fix potential NULL pointer deref in is_sdca_endpoint_present()
      commit: 6325766d69900d1aa9733fc7572456fc4427b708

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-10 14:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10 10:32 [PATCH] ASoC: sdw_utils: Fix potential NULL pointer deref in is_sdca_endpoint_present() Thorsten Blum
2025-06-10 12:32 ` Charles Keepax
2025-06-10 14:16 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).