Re: [PATCH v1] ALSA: Improve style of pnp_device_id array terminators

From: Jaroslav Kysela

Date: Tue Jun 09 2026 - 14:48:47 EST


On 6/9/26 18:46, Uwe Kleine-König (The Capable Hub) wrote:
To match how device-id array terminators look like for other device
types drop `.id = ""` from it and let the compiler care for zeroing the
entry.

There are no changes in the compiled drivers, only the source looks
nicer.

It's not true. Unless the matching and lookup functions are not changed, there's difference between NULL pointer and pointer to an empty string.

See match_device in drivers/pnp/driver.c - "while (*drv_id->id)". Your change will cause NULL pointer dereference.

Jaroslav

--
Jaroslav Kysela <perex@xxxxxxxx>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.