Attention is currently required from: Maulik V Vaghela, Tim Wawrzynczak, John Zhao. Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/56024 )
Change subject: drivers/usb/acpi: Create function to get PLD information ......................................................................
Patch Set 6:
(1 comment)
File src/drivers/usb/acpi/usb_acpi.c:
https://review.coreboot.org/c/coreboot/+/56024/comment/6839dc6b_9a0de372 PS6, Line 129: struct acpi_pld pld; : : if (!usb_device || !usb_device->chip_info || : usb_device->chip_ops != &drivers_usb_acpi_ops) : return NULL; : : if (config->use_custom_pld) : memcpy(&pld, &config->custom_pld, sizeof(pld)); : else : acpi_pld_fill_usb(&pld, config->type, &config->group); : : return &pld;
You can't return a reference to an object on the stack, it will cease to exist when the function ret […]
A hacky solution would be to fill &config->custom_pld and set config->use_custom_pld. That allows the PLD information to stay within the chip config.
``` ...
if (config->use_custom_pld == false) { acpi_pld_fill_usb(&config->custom_pld, config->type, &config->group); config->use_custom_pld = true; }
return &config->custom_pld; ```