Re: [PATCH v4] checkpatch: Check for missing sentinels in ID arrays
From: Joe Perches
Date: Thu Jul 03 2025 - 05:15:15 EST
On Wed, 2025-07-02 at 16:52 -0700, Brian Norris wrote:
> All of the ID tables based on <linux/mod_devicetable.h> (of_device_id,
> pci_device_id, ...) require their arrays to end in an empty sentinel
> value. That's usually spelled with an empty initializer entry (e.g.,
> "{}"), but also sometimes with explicit 0 entries, field initializers
> (e.g., '.id = ""'), or even a macro entry (like PCMCIA_DEVICE_NULL).
>
> Without a sentinel, device-matching code may read out of bounds.
[]
> Signed-off-by: Brian Norris <briannorris@xxxxxxxxxxxx>
Acked-by: Joe Perches <joe@xxxxxxxxxxx>