soundwire: intel: initialise quirk_mask before reading it
Subsystems (3)
PATCH 1/1 soundwire: intel: initialise quirk_mask before reading it
sdw_master_read_intel_prop() declares quirk_mask without an initialiser and ignores the return value of fwnode_property_read_u32(). When a BIOS does not describe "intel-quirk-mask" for a link, the property read leaves the variable untouched and stack garbage decides whether SDW_INTEL_QUIRK_MASK_BUS_DISABLE is honoured, so the link may be marked hw_disabled at random.
Initialise it to 0, matching is_link_enabled() in sound/hda/core/intel-sdw-acpi.c.
Found by code inspection, not observed at run time.
--- drivers/soundwire/intel_auxdevice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soundwire/intel_auxdevice.c +1 -1
@@ -158,7 +158,7 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus)struct sdw_intel_prop *intel_prop;struct fwnode_handle *link;char name[32 ]; -u32 quirk_mask; +u32 quirk_mask =0 ;/* Find master handle */ snprintf(name, sizeof(name),
Signature · 1 line
2.55.0
Quoted 8 lines · Boris Faure
sdw_master_read_intel_prop()declaresquirk_maskwithout an initialiser and ignores the return value offwnode_property_read_u32(). When a BIOS does not describe "intel-quirk-mask" for a link, the property read leaves the variable untouched and stack garbage decides whetherSDW_INTEL_QUIRK_MASK_BUS_DISABLEis honoured, so the link may be markedhw_disabledat random.[...]
Applied, thanks!
[1/1] soundwire: intel: initialise quirk_mask before reading it
commit: ee8a8cfe4e8d3c67456e554c988017c252710a25
Best regards,
Signature · 1 line
~Vinod