Skip to content

Commit 6325766

Browse files
tobluxbroonie
authored andcommitted
ASoC: sdw_utils: Fix potential NULL pointer deref in is_sdca_endpoint_present()
Check the return value of kzalloc() and exit early to avoid a potential NULL pointer dereference. Cc: stable@vger.kernel.org Fixes: 4f8ef33 ("ASoC: soc_sdw_utils: skip the endpoint that doesn't present") Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://patch.msgid.link/20250610103225.1475-2-thorsten.blum@linux.dev Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent a4e469c commit 6325766

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

sound/soc/sdw_utils/soc_sdw_utils.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,8 @@ static int is_sdca_endpoint_present(struct device *dev,
12051205
int i;
12061206

12071207
dlc = kzalloc(sizeof(*dlc), GFP_KERNEL);
1208+
if (!dlc)
1209+
return -ENOMEM;
12081210

12091211
adr_end = &adr_dev->endpoints[end_index];
12101212
dai_info = &codec_info->dais[adr_end->num];

0 commit comments

Comments
 (0)