On Thu, Aug 25, 2022 at 2:38 PM Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote: > > I have stumbled over __acpi_match_device() implementation and noticed > different types of termination of the struct acpi_device_id (ACPI ID > list), i.e. '{ }' vs. '{"", 0}'. > > As I read the code of the above mentioned function, I see that it > dereferences the id field without NULL check. This means we are quite > lucky (somebody before guarantees the match) we have no crash here. I'm not sure what you mean. In __acpi_match_device() id is a pointer used for walking the acpi_ids table (if not NULL). Its initial value is the acpi_ids value and it's incremented in every step, so it cannot be NULL. The loop is terminated if both the first byte of the device ID field and the cls field in the current row are both zeros, so both termination markers in use should work. Or am I missing anything?