From: Jaroslav Kysela <perex@perex.cz>
To: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: Takashi Iwai <tiwai@suse.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] ALSA: Improve style of pnp_device_id array terminators
Date: Tue, 9 Jun 2026 21:26:07 +0200 [thread overview]
Message-ID: <85646c66-d82e-4ce1-adac-7b7c7fd072a1@perex.cz> (raw)
In-Reply-To: <aihnGSmBPNjccGKR@monoceros>
On 6/9/26 21:20, Uwe Kleine-König (The Capable Hub) wrote:
> On Tue, Jun 09, 2026 at 08:38:57PM +0200, Jaroslav Kysela wrote:
>> 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.
>
> That's an easy but wrong diagnosis that I fell for first, too. Note that
> .id is not a pointer but a char array.
Right. Apologize for the noise. Thanks
Jaroslav
--
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
next prev parent reply other threads:[~2026-06-09 19:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 16:46 Uwe Kleine-König (The Capable Hub)
2026-06-09 18:38 ` Jaroslav Kysela
2026-06-09 19:20 ` Uwe Kleine-König (The Capable Hub)
2026-06-09 19:26 ` Jaroslav Kysela [this message]
2026-06-10 7:25 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85646c66-d82e-4ce1-adac-7b7c7fd072a1@perex.cz \
--to=perex@perex.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=tiwai@suse.com \
--cc=u.kleine-koenig@baylibre.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®