Skip to content

Commit 4a2eaad

Browse files
Henry MartingShahr
authored andcommitted
ASoC: Intel: avs: Fix null-ptr-deref in avs_component_probe()
devm_kasprintf() returns NULL when memory allocation fails. Currently, avs_component_probe() does not check for this case, which results in a NULL pointer dereference. Fixes: 739c031 ("ASoC: Intel: avs: Provide support for fallback topology") Reviewed-by: Cezary Rojewski <[email protected]> Reviewed-by: Ethan Carter Edwards <[email protected]> Signed-off-by: Henry Martin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent f527cb2 commit 4a2eaad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sound/soc/intel/avs/pcm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,8 @@ static int avs_component_probe(struct snd_soc_component *component)
927927
else
928928
mach->tplg_filename = devm_kasprintf(adev->dev, GFP_KERNEL,
929929
"hda-generic-tplg.bin");
930-
930+
if (!mach->tplg_filename)
931+
return -ENOMEM;
931932
filename = kasprintf(GFP_KERNEL, "%s/%s", component->driver->topology_name_prefix,
932933
mach->tplg_filename);
933934
if (!filename)

0 commit comments

Comments
 (0)