sound/soc/sdw_utils/soc_sdw_utils.c | 2 ++ 1 file changed, 2 insertions(+)
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
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
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
© 2016 - 2025 Red Hat, Inc.