Re: [PATCH 2/4] PCI/sysfs: Decouple acpi_index from the optional device name element
| Newsgroups | org.kernel.vger.linux-pci |
|---|---|
| Message-ID | <[email protected]> |
> Currently, dsm_get_label() validates both elements of the Device Name > _DSM result in a single conditional. The _DSM returns an ACPI package > of two elements, the instance number and the device name, where the > instance number is mandatory and the name is optional. Firmware that > implements no name must return a NULL string for it. > > Reads of "acpi_index" therefore fail whenever the name element is > malformed. That attribute exports only the instance number, and the > two elements do not depend on each other. > > Thus, validate each element only for the attribute that exports it. > So "acpi_index" now depends on the instance number alone, and "label" > reads fail with -EIO when the name element is neither a string nor a > buffer. The package elements pointer is read only after the object > type has been checked. > > On platforms with a valid instance number and a malformed name element > the "acpi_index" attribute starts returning data. Because udev derives > the onboard interface name from "acpi_index", an interface on such a > platform may be renamed once, on the first boot after this change. > That is the attribute assuming the value the firmware always > provided. > > Link: https://github.com/pciutils/pciutils/issues/175 > Signed-off-by: Krzysztof Wilczyński <[email protected]> Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2