Bug 219953 - Missing NULL check in avs_component_probe
Summary: Missing NULL check in avs_component_probe
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-28 11:40 UTC by henry
Modified: 2025-03-28 11:40 UTC (History)
0 users

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description henry 2025-03-28 11:40:02 UTC
sound: soc: intel: avs: pcm.c
Add NULL check in the avs_component_probe

When devm_kasprintf() fails, it returns a NULL pointer. However, this return value is not properly checked in the function avs_component_probe. 

A NULL check should be added after the devm_kasprintf call to handle potential NULL pointer dereference error.

CODE:
		if (((vendor_id >> 16) & 0xFFFF) == 0x8086)
			mach->tplg_filename = devm_kasprintf(adev->dev, GFP_KERNEL,
							     "hda-8086-generic-tplg.bin");
		else
			mach->tplg_filename = devm_kasprintf(adev->dev, GFP_KERNEL,
							     "hda-generic-tplg.bin");

		filename = kasprintf(GFP_KERNEL, "%s/%s", component->driver->topology_name_prefix,
				     mach->tplg_filename);

Note You need to log in before you can comment on or make changes to this bug.